Commit 475489c709f2ee45faa2133f19b9380ba32d20bb
1 parent
64255706
Exists in
master
and in
1 other branch
Small adjustments when trace window close.
Showing
1 changed file
with
11 additions
and
6 deletions
Show diff stats
src/trace/trace.c
@@ -132,20 +132,21 @@ | @@ -132,20 +132,21 @@ | ||
132 | 132 | ||
133 | } | 133 | } |
134 | 134 | ||
135 | - static void finalize(GObject *object) | ||
136 | - { | 135 | + static void finalize(GObject *object) { |
136 | + | ||
137 | debug("V3270Trace::%s",__FUNCTION__); | 137 | debug("V3270Trace::%s",__FUNCTION__); |
138 | 138 | ||
139 | V3270Trace *trace = GTK_V3270_TRACE(object); | 139 | V3270Trace *trace = GTK_V3270_TRACE(object); |
140 | 140 | ||
141 | - if(trace->filename) | ||
142 | - { | 141 | + if(trace->filename) { |
143 | g_free(trace->filename); | 142 | g_free(trace->filename); |
144 | trace->filename = NULL; | 143 | trace->filename = NULL; |
145 | } | 144 | } |
146 | 145 | ||
147 | - if(trace->log_handler) | ||
148 | - { | 146 | + if(trace->log_handler) { |
147 | + | ||
148 | + // Remove glib log handler | ||
149 | + | ||
149 | g_log_remove_handler(NULL,trace->log_handler); | 150 | g_log_remove_handler(NULL,trace->log_handler); |
150 | trace->log_handler = 0; | 151 | trace->log_handler = 0; |
151 | } | 152 | } |
@@ -154,6 +155,7 @@ | @@ -154,6 +155,7 @@ | ||
154 | { | 155 | { |
155 | debug("V3270Trace::%s - Removing trace widget association",__FUNCTION__); | 156 | debug("V3270Trace::%s - Removing trace widget association",__FUNCTION__); |
156 | 157 | ||
158 | + | ||
157 | g_object_notify_by_pspec( | 159 | g_object_notify_by_pspec( |
158 | G_OBJECT(trace->terminal), | 160 | G_OBJECT(trace->terminal), |
159 | GTK_V3270_GET_CLASS(trace->terminal)->properties.trace | 161 | GTK_V3270_GET_CLASS(trace->terminal)->properties.trace |
@@ -164,12 +166,15 @@ | @@ -164,12 +166,15 @@ | ||
164 | 166 | ||
165 | if(trace->hSession) { | 167 | if(trace->hSession) { |
166 | 168 | ||
169 | + g_message("Disabling lib3270 traces"); | ||
170 | + | ||
167 | size_t ix; | 171 | size_t ix; |
168 | for(ix=0;ix < G_N_ELEMENTS(toggles); ix++) | 172 | for(ix=0;ix < G_N_ELEMENTS(toggles); ix++) |
169 | lib3270_set_toggle(trace->hSession, toggles[ix],0); | 173 | lib3270_set_toggle(trace->hSession, toggles[ix],0); |
170 | 174 | ||
171 | lib3270_set_trace_handler(trace->hSession,trace->trace.handler,trace->trace.userdata); | 175 | lib3270_set_trace_handler(trace->hSession,trace->trace.handler,trace->trace.userdata); |
172 | trace->hSession = NULL; | 176 | trace->hSession = NULL; |
177 | + | ||
173 | } | 178 | } |
174 | 179 | ||
175 | g_clear_object(&trace->terminal); | 180 | g_clear_object(&trace->terminal); |