mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 15:31:14 +00:00
* Source/x11/XGServerWindow.m (-_createBuffer): Fix a big
memory leak noticed by Riccardo with the cairo backend, by #ifdef-ing out this method when using cairo. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37471 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
efe9c42c1c
commit
234703ae7a
2 changed files with 23 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2013-12-18 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/x11/XGServerWindow.m (-_createBuffer): Fix a big
|
||||
memory leak noticed by Riccardo with the cairo backend,
|
||||
by #ifdef-ing out this method when using cairo.
|
||||
|
||||
2013-12-13 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/x11/XGDragView.m (-_xWindowAcceptingDnDDescendentOf:...):
|
||||
|
|
|
@ -1826,6 +1826,22 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
|||
only done if the Window is buffered or retained. */
|
||||
- (void) _createBuffer: (gswindow_device_t *)window
|
||||
{
|
||||
#if (BUILD_GRAPHICS == GRAPHICS_cairo)
|
||||
/* The window->gdriverProtocol flag does not work as intended;
|
||||
it doesn't get set until after _createBuffer is called,
|
||||
so it's not a relaible way to tell whether we need to create
|
||||
a backing pixmap here.
|
||||
|
||||
This method was causing a serious leak with the default
|
||||
Cairo XGCairoModernSurface because we were erroneously
|
||||
creating a pixmap, and then not releasing it in -termwindow:
|
||||
because the GDriverHandlesBacking flag was set in between.
|
||||
|
||||
So this #if servers as a foolproof way of ensuring we
|
||||
don't ever create window->buffer in the default configuration.
|
||||
*/
|
||||
return;
|
||||
#else
|
||||
if (window->type == NSBackingStoreNonretained
|
||||
|| (window->gdriverProtocol & GDriverHandlesBacking))
|
||||
return;
|
||||
|
@ -1855,6 +1871,7 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
|||
0, 0,
|
||||
NSWidth(window->xframe),
|
||||
NSHeight(window->xframe));
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue