Created attachment 89998 [details] Sample file with one image and short macro. Suppose you have an Impress presentation and want to export the images and import then again into a writer document. When your macro first exports the images and then calls bitmaps.insertByName("myTempName", fileurl) the inserted file remains locked on Windows 7, so it cannot be removed (for cleanup) by the macro via kill(filename). I attach a sample presentation with one image. The macro may be started via Tools -> Macro -> Run, ExportTest.odp->Standard->Module1. It first exports the image into your "tmp"-directory, creates a new writer document, and inserts the exported image into that document. After the image was imported, you may switch to the Windows explorer and try to remove the image file by hand, and Windows tells you (translated, so the real english text may differ) "The file cannot be deleted because it is still in use by LibreOffice". The file remains locked until Libreoffice, including the QuickStart menu entry, is closed.
Created attachment 90042 [details] Added delete statement
hi Ulrich, that definitely looks like a memory leak (in addition to the Windows locking problem), thanks for finding it. can you please send a license mail to libreoffice@lists.freedesktop.org as described on this page: https://wiki.documentfoundation.org/Development/Developers#Example_Statement feel free to add an entry for yourself on the page too.
As far as I can see, the locking is also fixed. Seems that the ctor closes the file.
Ulrich Kitzinger committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=cc36dfc9bf4f327c359d171d8d05f0ede049164e fdo#72156: GraphicObject: Added missing delete of stream The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Ulrich Kitzinger committed a patch related to this issue. It has been pushed to "libreoffice-4-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f7b42987c4247244b23f0405fc5af58a92afd945&h=libreoffice-4-2 fdo#72156: GraphicObject: Added missing delete of stream It will be available in LibreOffice 4.2. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Ulrich Kitzinger committed a patch related to this issue. It has been pushed to "libreoffice-4-1": http://cgit.freedesktop.org/libreoffice/core/commit/?id=37ed490fd7bfef1863b26d0f791cba1a04811459&h=libreoffice-4-1 fdo#72156: GraphicObject: Added missing delete of stream It will be available in LibreOffice 4.1.5. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Ulrich Kitzinger committed a patch related to this issue. It has been pushed to "libreoffice-4-1-4": http://cgit.freedesktop.org/libreoffice/core/commit/?id=fffa2b69209f9c1387a6182ca1422aa3f71c1cae&h=libreoffice-4-1-4 fdo#72156: GraphicObject: Added missing delete of stream It will be available already in LibreOffice 4.1.4. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.