Shabbos13: 3
הַקּוֹרֵעַ בַּחֲמָתוֹ, וְעַל מֵתוֹ, וְכָל הַמְקַלְקְלִין, פְּטוּרִין. וְהַמְקַלְקֵל עַל־מְנָת לְתַקֵּן, שִׁעוּרוֹ כִמְתַקֵּן.
One who tears in his anger, or for his dead, and all who act destructively, are exempt. But one who destroys in order to repair, his [minimum] measure [for liability] is the same as for repairs.