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 | 132 | |
133 | 133 | } |
134 | 134 | |
135 | - static void finalize(GObject *object) | |
136 | - { | |
135 | + static void finalize(GObject *object) { | |
136 | + | |
137 | 137 | debug("V3270Trace::%s",__FUNCTION__); |
138 | 138 | |
139 | 139 | V3270Trace *trace = GTK_V3270_TRACE(object); |
140 | 140 | |
141 | - if(trace->filename) | |
142 | - { | |
141 | + if(trace->filename) { | |
143 | 142 | g_free(trace->filename); |
144 | 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 | 150 | g_log_remove_handler(NULL,trace->log_handler); |
150 | 151 | trace->log_handler = 0; |
151 | 152 | } |
... | ... | @@ -154,6 +155,7 @@ |
154 | 155 | { |
155 | 156 | debug("V3270Trace::%s - Removing trace widget association",__FUNCTION__); |
156 | 157 | |
158 | + | |
157 | 159 | g_object_notify_by_pspec( |
158 | 160 | G_OBJECT(trace->terminal), |
159 | 161 | GTK_V3270_GET_CLASS(trace->terminal)->properties.trace |
... | ... | @@ -164,12 +166,15 @@ |
164 | 166 | |
165 | 167 | if(trace->hSession) { |
166 | 168 | |
169 | + g_message("Disabling lib3270 traces"); | |
170 | + | |
167 | 171 | size_t ix; |
168 | 172 | for(ix=0;ix < G_N_ELEMENTS(toggles); ix++) |
169 | 173 | lib3270_set_toggle(trace->hSession, toggles[ix],0); |
170 | 174 | |
171 | 175 | lib3270_set_trace_handler(trace->hSession,trace->trace.handler,trace->trace.userdata); |
172 | 176 | trace->hSession = NULL; |
177 | + | |
173 | 178 | } |
174 | 179 | |
175 | 180 | g_clear_object(&trace->terminal); | ... | ... |