<div dir="ltr">Thank you. The patch has been attached to the bug.<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 6, 2016 at 12:51 AM, Adrian Johnson <span dir="ltr"><<a href="mailto:ajohnson@redneon.com" target="_blank">ajohnson@redneon.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 05/04/16 19:52, Fred Beca wrote:<br>
> Hi,<br>
><br>
> There have been a memory leak on win32 platform for a while because of<br>
> the static __cairo_win32_device object that is never released<br>
> (see <a href="https://bugs.freedesktop.org/show_bug.cgi?id=67171" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=67171</a>)<br>
><br>
> Please find attached a simple patch that fixes the problem by adding a<br>
> win32-specific cleanup call in the cairo_debug_reset_static_data<br>
> function. I hope it can be added to the official release to remove the leak.<br>
<br>
</span>If you could add the patch to bug 67171 and I will test and commit it<br>
next time I am working on the windows backend.<br>
<span><br>
><br>
> Regards,<br>
><br>
> Fred<br>
><br>
> Index: cairo-debug.c<br>
> ===================================================================<br>
> --- cairo-debug.c(cairo-1.14.6)<br>
</span>> +++ cairo-debug.c(working copy)<br>
<span>> @@ -89,7 +89,9 @@<br>
> #if CAIRO_HAS_DRM_SURFACE<br>
> _cairo_drm_device_reset_static_data ();<br>
> #endif<br>
> -<br>
> +#if CAIRO_HAS_WIN32_SURFACE<br>
> + _cairo_win32_device_reset_static_data ();<br>
> +#endif<br>
> _cairo_default_context_reset_static_data ();<br>
><br>
> #if CAIRO_HAS_COGL_SURFACE<br>
> Index: cairoint.h<br>
> ===================================================================<br>
> --- cairoint.h(cairo-1.14.6)<br>
</span>> +++ cairoint.h(working copy)<br>
<span>> @@ -442,6 +442,11 @@<br>
> cairo_private void<br>
> _cairo_win32_font_reset_static_data (void);<br>
><br>
> +#if CAIRO_HAS_WIN32_SURFACE<br>
> +cairo_private void<br>
> +_cairo_win32_device_reset_static_data (void);<br>
> +#endif<br>
> +<br>
> #if CAIRO_HAS_COGL_SURFACE<br>
> void<br>
> _cairo_cogl_context_reset_static_data (void);<br>
> Index: win32/cairo-win32-device.c<br>
> ===================================================================<br>
> --- win32/cairo-win32-device.c(cairo-1.14.6)<br>
</span>> +++ win32/cairo-win32-device.c(working copy)<br>
<div><div>> @@ -187,3 +187,12 @@<br>
><br>
> return flags;<br>
> }<br>
> +<br>
> +void _cairo_win32_device_reset_static_data (void)<br>
> +{<br>
> + if (__cairo_win32_device != NULL) {<br>
> +cairo_device_t *device = __cairo_win32_device;<br>
> +__cairo_win32_device = NULL;<br>
> +cairo_device_destroy (device);<br>
> + }<br>
> +}<br>
><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div></div>