From f9334f6f7ef5e0b29fdc66d36d39ca164dfc27e5 Mon Sep 17 00:00:00 2001 From: yangxx Date: Thu, 11 Sep 2003 18:14:25 +0000 Subject: [PATCH] git-svn-id: http://ltt.polymtl.ca/svn@234 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c | 5 ++++- ltt/branches/poly/lttv/modules/guiEvents.c | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c b/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c index 53a2770f..b766fb08 100644 --- a/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c +++ b/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c @@ -85,12 +85,15 @@ void insertView(GtkWidget* widget, view_constructor constructor) { GtkCustom * custom; mainWindow * mwData; + GtkWidget * viewer; mwData = get_window_data_struct(widget); if(!mwData->CurrentTab) return; custom = mwData->CurrentTab->custom; - gtk_custom_widget_add(custom, (GtkWidget*)constructor(mwData)); + viewer = (GtkWidget*)constructor(mwData); + if(viewer) + gtk_custom_widget_add(custom, viewer); } void get_label_string (GtkWidget * text, gchar * label) diff --git a/ltt/branches/poly/lttv/modules/guiEvents.c b/ltt/branches/poly/lttv/modules/guiEvents.c index 27230d11..89c36e54 100644 --- a/ltt/branches/poly/lttv/modules/guiEvents.c +++ b/ltt/branches/poly/lttv/modules/guiEvents.c @@ -230,7 +230,9 @@ hGuiEvents(mainWindow * pmParentWindow) { EventViewerData* Event_Viewer_Data = GuiEvents(pmParentWindow) ; - return Event_Viewer_Data->HBox_V ; + if(Event_Viewer_Data) + return Event_Viewer_Data->HBox_V ; + else return NULL; } @@ -424,6 +426,8 @@ GuiEvents(mainWindow *pmParentWindow) Event_Viewer_Data->raw_trace_data = Event_Viewer_Data->raw_trace_data_first; get_events(Event_Viewer_Data, start,end, RESERVE_SIZE); Event_Viewer_Data->Number_Of_Events = Event_Viewer_Data->raw_trace_data->len; + + if(Event_Viewer_Data->raw_trace_data->len == 0) return NULL; time_period = g_new(TimePeriod, 1); data = g_ptr_array_index(Event_Viewer_Data->raw_trace_data,0); -- 2.34.1