Commit 24669a81f28667db46bed174ab26118eb87fd4e4
1 parent
d6b8032f
Exists in
master
and in
1 other branch
Fixing valgrind's detections.
Showing
6 changed files
with
80 additions
and
9 deletions
Show diff stats
src/dialogs/colorscheme.c
| ... | ... | @@ -126,8 +126,8 @@ |
| 126 | 126 | |
| 127 | 127 | static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkRGBA *clr) |
| 128 | 128 | { |
| 129 | - const gchar * val; | |
| 130 | - size_t f; | |
| 129 | + gchar * val; | |
| 130 | + size_t f; | |
| 131 | 131 | |
| 132 | 132 | // Load base colors |
| 133 | 133 | val = g_key_file_get_string(conf,group,"base",NULL); |
| ... | ... | @@ -165,7 +165,7 @@ |
| 165 | 165 | |
| 166 | 166 | } |
| 167 | 167 | g_strfreev(str); |
| 168 | - | |
| 168 | + g_free(val); | |
| 169 | 169 | } |
| 170 | 170 | else |
| 171 | 171 | { |
| ... | ... | @@ -194,6 +194,7 @@ |
| 194 | 194 | gdk_rgba_parse(clr+V3270_COLOR_FIELD+f,str[f]); |
| 195 | 195 | |
| 196 | 196 | g_strfreev(str); |
| 197 | + g_free(val); | |
| 197 | 198 | } |
| 198 | 199 | |
| 199 | 200 | // Load selection colors |
| ... | ... | @@ -208,6 +209,7 @@ |
| 208 | 209 | gdk_rgba_parse(clr+V3270_COLOR_SELECTED_BG+f,str[f]); |
| 209 | 210 | |
| 210 | 211 | g_strfreev(str); |
| 212 | + g_free(val); | |
| 211 | 213 | } |
| 212 | 214 | |
| 213 | 215 | // Load OIA colors |
| ... | ... | @@ -243,6 +245,7 @@ |
| 243 | 245 | } |
| 244 | 246 | |
| 245 | 247 | g_strfreev(str); |
| 248 | + g_free(val); | |
| 246 | 249 | } |
| 247 | 250 | |
| 248 | 251 | // Setup extended elements |
| ... | ... | @@ -250,7 +253,10 @@ |
| 250 | 253 | |
| 251 | 254 | val = g_key_file_get_string(conf,group,"cross-hair",NULL); |
| 252 | 255 | if(val) |
| 256 | + { | |
| 253 | 257 | gdk_rgba_parse(clr+V3270_COLOR_CROSS_HAIR,val); |
| 258 | + g_free(val); | |
| 259 | + } | |
| 254 | 260 | |
| 255 | 261 | } |
| 256 | 262 | |
| ... | ... | @@ -297,7 +303,7 @@ |
| 297 | 303 | { |
| 298 | 304 | // Setup colors for current entry |
| 299 | 305 | GdkRGBA * clr = GTK_V3270_COLOR_SCHEME(widget)->schemes+index; |
| 300 | - const gchar * label = g_key_file_get_locale_string(conf,group[g],"label",NULL,NULL); | |
| 306 | + gchar * label = g_key_file_get_locale_string(conf,group[g],"label",NULL,NULL); | |
| 301 | 307 | |
| 302 | 308 | load_color_scheme(conf,group[g],clr); |
| 303 | 309 | |
| ... | ... | @@ -308,6 +314,8 @@ |
| 308 | 314 | 1, clr, |
| 309 | 315 | -1); |
| 310 | 316 | |
| 317 | + g_free(label); | |
| 318 | + | |
| 311 | 319 | // move to next color list |
| 312 | 320 | index += V3270_COLOR_COUNT; |
| 313 | 321 | } | ... | ... |
src/include/v3270.h
src/terminal/font.c
| ... | ... | @@ -79,7 +79,15 @@ void v3270_update_font_metrics(v3270 *terminal, cairo_t *cr, unsigned int width, |
| 79 | 79 | |
| 80 | 80 | terminal->font.weight = lib3270_get_toggle(terminal->host,LIB3270_TOGGLE_BOLD) ? CAIRO_FONT_WEIGHT_BOLD : CAIRO_FONT_WEIGHT_NORMAL; |
| 81 | 81 | |
| 82 | - cairo_select_font_face(cr,terminal->font.family, CAIRO_FONT_SLANT_NORMAL,terminal->font.weight); | |
| 82 | + if(terminal->font.face) | |
| 83 | + { | |
| 84 | + cairo_font_face_destroy(terminal->font.face); | |
| 85 | + } | |
| 86 | + | |
| 87 | + terminal->font.face = cairo_toy_font_face_create(terminal->font.family, CAIRO_FONT_SLANT_NORMAL, terminal->font.weight); | |
| 88 | + cairo_set_font_face(cr,terminal->font.face); | |
| 89 | + | |
| 90 | + // cairo_select_font_face(cr,terminal->font.family, CAIRO_FONT_SLANT_NORMAL,terminal->font.weight); | |
| 83 | 91 | |
| 84 | 92 | if(terminal->font.scaled) |
| 85 | 93 | { | ... | ... |
src/terminal/widget.c
| ... | ... | @@ -232,6 +232,16 @@ static void v3270_toggle_changed(G_GNUC_UNUSED v3270 *widget, G_GNUC_UNUSED LIB3 |
| 232 | 232 | static void finalize(GObject *object) |
| 233 | 233 | { |
| 234 | 234 | debug("V3270::%s",__FUNCTION__); |
| 235 | + | |
| 236 | + v3270 * terminal = GTK_V3270(object); | |
| 237 | + | |
| 238 | + if(terminal->host) | |
| 239 | + { | |
| 240 | + // Release session | |
| 241 | + lib3270_session_free(terminal->host); | |
| 242 | + terminal->host = NULL; | |
| 243 | + } | |
| 244 | + | |
| 235 | 245 | G_OBJECT_CLASS(v3270_parent_class)->finalize(object); |
| 236 | 246 | } |
| 237 | 247 | |
| ... | ... | @@ -579,10 +589,6 @@ static void v3270_destroy(GtkWidget *widget) |
| 579 | 589 | // Cleanup |
| 580 | 590 | lib3270_reset_callbacks(terminal->host); |
| 581 | 591 | lib3270_set_user_data(terminal->host,NULL); |
| 582 | - | |
| 583 | - // Release session | |
| 584 | - lib3270_session_free(terminal->host); | |
| 585 | - terminal->host = NULL; | |
| 586 | 592 | } |
| 587 | 593 | |
| 588 | 594 | if(terminal->accessible) |
| ... | ... | @@ -604,6 +610,11 @@ static void v3270_destroy(GtkWidget *widget) |
| 604 | 610 | terminal->font.scaled = NULL; |
| 605 | 611 | } |
| 606 | 612 | |
| 613 | + if(terminal->font.face) { | |
| 614 | + cairo_font_face_destroy(terminal->font.face); | |
| 615 | + terminal->font.face = NULL; | |
| 616 | + } | |
| 617 | + | |
| 607 | 618 | if(terminal->surface) |
| 608 | 619 | { |
| 609 | 620 | cairo_surface_destroy(terminal->surface); | ... | ... |
src/trace/widget.c
| ... | ... | @@ -110,6 +110,8 @@ |
| 110 | 110 | if(widget->hSession == hSession) |
| 111 | 111 | return; |
| 112 | 112 | |
| 113 | + debug("%s: Session changes %p -> %p", __FUNCTION__, widget->hSession, hSession); | |
| 114 | + | |
| 113 | 115 | if(widget->hSession) { |
| 114 | 116 | lib3270_set_trace_handler(widget->hSession,widget->trace.handler,widget->trace.userdata); |
| 115 | 117 | } | ... | ... |
valgrind.suppression
| ... | ... | @@ -97,3 +97,44 @@ |
| 97 | 97 | fun:g_type_create_instance |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | +{ | |
| 101 | + fontconfig_FcPatternDuplicate | |
| 102 | + Memcheck:Leak | |
| 103 | + ... | |
| 104 | + fun:FcPatternDuplicate | |
| 105 | +} | |
| 106 | + | |
| 107 | +{ | |
| 108 | + gtk_style_context_set_state | |
| 109 | + Memcheck:Leak | |
| 110 | + ... | |
| 111 | + fun:gtk_style_context_set_state | |
| 112 | +} | |
| 113 | + | |
| 114 | +{ | |
| 115 | + g_param_spec_flags | |
| 116 | + Memcheck:Leak | |
| 117 | + ... | |
| 118 | + fun:g_param_spec_flags | |
| 119 | +} | |
| 120 | + | |
| 121 | +{ | |
| 122 | + gtk_style_new | |
| 123 | + Memcheck:Leak | |
| 124 | + ... | |
| 125 | + fun:gtk_style_new | |
| 126 | +} | |
| 127 | + | |
| 128 | +{ | |
| 129 | + libcrypto_BIO_read | |
| 130 | + Memcheck:Cond | |
| 131 | + fun:BIO_read | |
| 132 | +} | |
| 133 | + | |
| 134 | +{ | |
| 135 | + cairo_mask | |
| 136 | + Memcheck:Cond | |
| 137 | + ... | |
| 138 | + fun:cairo_mask | |
| 139 | +} | |
| 140 | + | ... | ... |