Try to fix crasher on mixing glib free and free.

This commit is contained in:
Dave Davenport 2015-11-15 13:12:43 +01:00
parent 2eaffceada
commit 238a34162a
3 changed files with 36 additions and 30 deletions

View File

@ -217,14 +217,20 @@ static void dmenu_mode_free ( Switcher *sw )
return;
}
DmenuModePrivateData *pd = (DmenuModePrivateData *) sw->private_data;
g_strfreev ( pd->cmd_list );
if ( pd != NULL ) {
for ( size_t i = 0; i < pd->cmd_list_length; i++ ) {
if ( pd->cmd_list[i] ) {
free ( pd->cmd_list[i] );
}
}
g_free ( pd->cmd_list );
g_free ( pd->urgent_list );
g_free ( pd->active_list );
g_free ( pd );
sw->private_data = NULL;
}
}
static void dmenu_mode_init ( Switcher *sw )
{