From e94d5233dd7939c54eb52fff456e817cecdf0a4c Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Fri, 11 Mar 2016 06:43:06 +0100 Subject: work on sane lifecylce for SfxFilter all SfxFilter instances should now be hold inside of a std::shared_ptr. This fixes a number of huge memory leaks in the test framework and removes one huge source of memory issue in sfx2. SfxMedium contains a pointer to the SfxFilter but does not own. Therefore it is required that any SfxFilter belonging to a SfxMedium lives longer. However this seems to work mostly by hoping that all SfxFilter instances are stored in a global array. As we have seen with the tests this is not true (there are also some cases inside of sd that seem to not follow that pattern as well). Change-Id: I12fd04a504cc4efc0a94967abd91c6fe2c6a8ce8 Reviewed-on: https://gerrit.libreoffice.org/23140 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard --- include/vbahelper/vbaaccesshelper.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/vbahelper') diff --git a/include/vbahelper/vbaaccesshelper.hxx b/include/vbahelper/vbaaccesshelper.hxx index 5284f722fc28..3d14a399548a 100644 --- a/include/vbahelper/vbaaccesshelper.hxx +++ b/include/vbahelper/vbaaccesshelper.hxx @@ -55,7 +55,7 @@ namespace ooo { bool bRes( false ); const SfxMedium *pMedium = rDocShell.GetMedium(); - const SfxFilter *pFilt = pMedium ? pMedium->GetFilter() : nullptr; + std::shared_ptr pFilt = pMedium ? pMedium->GetFilter() : nullptr; if ( pFilt && pFilt->IsAlienFormat() ) bRes = pFilt->GetMimeType().equalsAscii( pMimeType ); return bRes; -- cgit