Fixed crash of applet during the package update, if HAL wasn't previously initialized.
[flashlight-appl] / 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) {