summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-11-14 01:13:38 +0000
committerjstebbins <[email protected]>2009-11-14 01:13:38 +0000
commit5ea29c6e1bd5d954f2d2b0bfee61fc979e5a111c (patch)
treead11241bf1a8153cdbfbc36b1afc2ef51070c1b4 /gtk/src
parentbfdde46b2178ec4aea7082f81476ffafb857a7d5 (diff)
LinGui: don't crash if hal fails to initialize.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2929 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/callbacks.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 5067767a9..ea93955fe 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -3488,7 +3488,7 @@ dvd_device_list()
}
#if !defined(_WIN32)
-static LibHalContext *hal_ctx;
+static LibHalContext *hal_ctx = NULL;
#endif
gboolean
@@ -3499,6 +3499,9 @@ ghb_is_cd(GDrive *gd)
LibHalDrive *halDrive;
LibHalDriveType dtype;
+ if (hal_ctx == NULL)
+ return FALSE;
+
device = g_drive_get_identifier(gd, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
if (device == NULL)
return FALSE;
@@ -4213,6 +4216,7 @@ ghb_hal_init()
dbus_error_free (&error);
libhal_ctx_free (hal_ctx);
dbus_g_connection_unref(gconn);
+ hal_ctx = NULL;
return;
}
@@ -4228,6 +4232,7 @@ ghb_hal_init()
libhal_ctx_shutdown (hal_ctx, NULL);
libhal_ctx_free (hal_ctx);
+ hal_ctx = NULL;
dbus_g_connection_unref(gconn);
return;
}