summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-09-10 20:55:45 +0200
committerDave Davenport <qball@gmpclient.org>2017-09-10 20:59:31 +0200
commit65eb9b7505253df8df9737289ba13c4ee83bb4b7 (patch)
treefed1e5687293ccbc2b80b5be233636ea0558e830
parent19cc794018f745be532bd9e98fc2c15b537c9e88 (diff)
Fix crash on destroying script modi
-rw-r--r--source/rofi.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/rofi.c b/source/rofi.c
index c13df1fe..0e2b3a0f 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -415,9 +415,6 @@ static void cleanup ()
// Cleaning up memory allocated by the Xresources file.
config_xresource_free ();
- for ( unsigned int i = 0; i < num_modi; i++ ) {
- mode_free ( &( modi[i] ) );
- }
g_free ( modi );
g_free ( config_path );
@@ -549,7 +546,12 @@ static void rofi_collect_modi_destroy ( void )
{
for ( unsigned int i = 0; i < num_available_modi; i++ ) {
if ( available_modi[i]->module ) {
- g_module_close ( available_modi[i]->module );
+ GModule *mod = available_modi[i]->module;
+ available_modi[i] = NULL;
+ g_module_close ( mod );
+ }
+ if ( available_modi[i] ) {
+ mode_free ( &(available_modi[i]) );
}
}
g_free ( available_modi );