Fixed crash of applet during the package update, if HAL wasn't previously initialized.
authorRoman Moravcik <roman.moravcik@gmail.com>
Sat, 3 Apr 2010 06:49:35 +0000 (08:49 +0200)
committerRoman Moravcik <roman.moravcik@gmail.com>
Sat, 3 Apr 2010 06:49:35 +0000 (08:49 +0200)
src/flashlight_applet.c

index 641e8dd..cb9280a 100644 (file)
@@ -297,6 +297,7 @@ flashlight_status_plugin_init (FlashlightPlugin *plugin)
                }
                libhal_ctx_set_user_data (priv->hal, NULL);
                libhal_ctx_free (priv->hal);
+               priv->hal = NULL;
                return;
        }
 
@@ -327,6 +328,7 @@ flashlight_status_plugin_finalize (GObject *object)
                libhal_ctx_shutdown (priv->hal, NULL);
                libhal_ctx_free (priv->hal);
        }
+       priv->hal = NULL;
 
        /* cancel status timer */
        if (priv->status_timer) {