mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
Fix for #199, properly reset pointer to NULL after free'ing
This commit is contained in:
parent
8d6a78939c
commit
f8ed184415
2 changed files with 8 additions and 2 deletions
|
@ -178,7 +178,9 @@ static void x11_cache_create ( void )
|
||||||
static void x11_cache_free ( void )
|
static void x11_cache_free ( void )
|
||||||
{
|
{
|
||||||
winlist_free ( cache_xattr );
|
winlist_free ( cache_xattr );
|
||||||
|
cache_xattr = NULL;
|
||||||
winlist_free ( cache_client );
|
winlist_free ( cache_client );
|
||||||
|
cache_client = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1485,6 +1485,8 @@ static void teardown ( int pfd )
|
||||||
XUnmapWindow ( display, main_window );
|
XUnmapWindow ( display, main_window );
|
||||||
XDestroyWindow ( display, main_window );
|
XDestroyWindow ( display, main_window );
|
||||||
main_window = None;
|
main_window = None;
|
||||||
|
}
|
||||||
|
if ( gc != NULL ) {
|
||||||
XFreeGC ( display, gc );
|
XFreeGC ( display, gc );
|
||||||
gc = NULL;
|
gc = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1615,11 +1617,13 @@ static void cleanup ()
|
||||||
if ( main_window != None ) {
|
if ( main_window != None ) {
|
||||||
// We should never hit this code.
|
// We should never hit this code.
|
||||||
release_keyboard ( display );
|
release_keyboard ( display );
|
||||||
XFreeGC ( display, gc );
|
|
||||||
gc = NULL;
|
|
||||||
XDestroyWindow ( display, main_window );
|
XDestroyWindow ( display, main_window );
|
||||||
main_window = None;
|
main_window = None;
|
||||||
}
|
}
|
||||||
|
if ( gc != NULL ) {
|
||||||
|
XFreeGC ( display, gc );
|
||||||
|
gc = NULL;
|
||||||
|
}
|
||||||
XCloseDisplay ( display );
|
XCloseDisplay ( display );
|
||||||
display = NULL;
|
display = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue