Fix a memory leak in gdk_display_open in the directfb backend

Patch by Andre Draszik, bug 609172
This commit is contained in:
Matthias Clasen 2010-02-23 13:06:44 -05:00 committed by Tristan Van Berkom
parent db0faed54c
commit d1babc7775

View File

@ -93,17 +93,19 @@ GdkDisplay * gdk_display_open (const gchar *display_name)
{
DirectFBError ("gdk_display_open: GetDisplayLayer", ret);
directfb->Release (directfb);
directfb = NULL;
_gdk_display->directfb = NULL;
return NULL;
}
ret=directfb->GetInputDevice (directfb, DIDID_KEYBOARD, &keyboard);
if (ret != DFB_OK){
ret = directfb->GetInputDevice (directfb, DIDID_KEYBOARD, &keyboard);
if (ret != DFB_OK)
{
DirectFBError ("gdk_display_open: GetInputDevice", ret);
return NULL;
}
directfb->Release (directfb);
_gdk_display->directfb = NULL;
return NULL;
}
_gdk_display->layer=layer;
_gdk_display->keyboard=keyboard;