Bug 98859 - Gdiplus::GpSolidFill not freed in WinSalGraphicsImpl::drawPolyPolygon, possible memory leak
Summary: Gdiplus::GpSolidFill not freed in WinSalGraphicsImpl::drawPolyPolygon, possib...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
5.1.0.0.alpha1
Hardware: All Windows (All)
: medium normal
Assignee: Armin Le Grand
URL:
Whiteboard: target:5.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-24 12:41 UTC by Armin Le Grand
Modified: 2016-09-18 14:16 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Armin Le Grand 2016-03-24 12:41:25 UTC
In gdiimpl.cxx in Win implementation of graphic sal stuff, a Gdiplus::GpSolidFill is constructed but not freed. WinSalGraphicsImpl::drawPolyPolygon needs to be adapted
Comment 1 Armin Le Grand 2016-03-24 12:44:39 UTC
Of course only on Windows. Problem could be solved by freeing the Gdiplus::GpSolidFill using

GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)

(see https://msdn.microsoft.com/en-us/library/windows/desktop/ms533974%28v=vs.85%29.aspx). But basic problem is usage of the procedural calls per se. To make sure that does not happen on other places, replace that calls (starting with Gdiplus::DllExports::Gdip*) using the Object-Oriented approach
Comment 2 Armin Le Grand 2016-03-24 13:44:12 UTC
Change done, tested if it works. Submitted to gerrit.
Comment 3 Commit Notification 2016-03-29 14:36:44 UTC
Armin Le Grand committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=84f7867de70fb91e7e3bd8acc8175b4be4be31dd

tdf#98859 use ObjectOriented approach for Gdiplus

It will be available in 5.2.0.

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.
Comment 4 Xisco Faulí 2016-09-15 20:50:32 UTC
Hi,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?
Regards
Comment 5 Armin Le Grand 2016-09-16 07:43:59 UTC
I was told that as a developer I should not do exactly that - it will be tested for being fixed and closed by QA. Explanation was that QA wants to explicitely check if the task is solved from QA-Perspective (sometimes different from dev one, thus a good thing from my POV). Did that change..?
Comment 6 Xisco Faulí 2016-09-16 09:43:39 UTC
(In reply to Armin Le Grand (CIB) from comment #5)
> I was told that as a developer I should not do exactly that - it will be
> tested for being fixed and closed by QA. Explanation was that QA wants to
> explicitely check if the task is solved from QA-Perspective (sometimes
> different from dev one, thus a good thing from my POV). Did that change..?

Normally, when a bug is fixed, it should be set to RESOLVED FIXED by the developer when he/she believes it's fixed. Later on, QA should verify it and change it to VERIFIED FIXED.
This is the normal case for most of the bugs we have in BZ and I believe you should follow this rule as well.