[dia] [scan-build] Null dereference (not really)
- From: Hans Breuer <hans src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [dia] [scan-build] Null dereference (not really)
- Date: Sun, 13 Dec 2009 19:12:18 +0000 (UTC)
commit d5d0ebda470fa6e5865f70505411fd25f2c8dc64
Author: Hans Breuer <hans breuer org>
Date: Sun Dec 13 14:11:53 2009 +0100
[scan-build] Null dereference (not really)
Document create_layer_dialog() making a valid layer_dialog
pointer by g_assert() to silence scan-build.
app/layer_dialog.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/app/layer_dialog.c b/app/layer_dialog.c
index ca90e29..34d006b 100644
--- a/app/layer_dialog.c
+++ b/app/layer_dialog.c
@@ -691,6 +691,7 @@ layer_dialog_update_diagram_list(void)
else
create_layer_dialog();
}
+ g_assert(layer_dialog != NULL); /* must be valid now */
/* oh this options: here integrated UI ;( */
if (!layer_dialog->diagram_omenu)
return;
@@ -762,6 +763,7 @@ layer_dialog_show()
{
if (layer_dialog == NULL || layer_dialog->dialog == NULL)
create_layer_dialog();
+ g_assert(layer_dialog != NULL); /* must be valid now */
gtk_window_present(GTK_WINDOW(layer_dialog->dialog));
}
}
@@ -794,6 +796,7 @@ layer_dialog_set_diagram(Diagram *dia)
if (layer_dialog == NULL || layer_dialog->dialog == NULL)
create_layer_dialog(); /* May have been destroyed */
+ g_assert(layer_dialog != NULL); /* must be valid now */
gtk_container_foreach (GTK_CONTAINER(layer_dialog->layer_list),
_layer_widget_clear_layer, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]