fix SbxArrayRef leak

found by running
	make CppunitTest_sc_macros_test CPPUNIT_TEST_NAME=testTdf146742
under ASAN with detect_leaks=1

This is the same leak mechanism as
    commit ff5487aaab39aa8b862da1cf0b3f41e8fb1f8d7d
    Author: Noel Grandin <noel.grandin@collabora.co.uk>
    Date:   Thu May 14 13:19:39 2026 +0200
    fix SbxArrayRef leak
and we use the same kind of fix.

Change-Id: Ia133e73062fca27ff6dbc344045ac62873cc7b4a
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3005
Tested-by: Noel Grandin <noel.grandin@collabora.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 834c60bef01e86a5af7f8862c47341cfdd8d70fa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206323
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Noel Grandin
2026-06-10 22:27:34 +02:00
committed by Xisco Fauli
parent 0bf1c1bd52
commit 1da9c73591
+3
View File
@@ -3598,6 +3598,9 @@ void ScInterpreter::ScMacro()
}
}
// prevent cycles from leaking memory
refPar->Clear();
if (bVolatileMacro && meVolatileType == NOT_VOLATILE)
meVolatileType = VOLATILE_MACRO;
#endif