Commit e4cffdc6408e635b6eefb2e157baaa59b0731e01
1 parent
4a8e884a
Exists in
master
and in
5 other branches
Teste rapido com valgrind, retirando erros no gerenciamento de memória
Showing
5 changed files
with
26 additions
and
4 deletions
Show diff stats
pw3270.cbp
@@ -134,6 +134,7 @@ | @@ -134,6 +134,7 @@ | ||
134 | <Unit filename="src/gtk/v3270/widget.c"> | 134 | <Unit filename="src/gtk/v3270/widget.c"> |
135 | <Option compilerVar="CC" /> | 135 | <Option compilerVar="CC" /> |
136 | </Unit> | 136 | </Unit> |
137 | + <Unit filename="src/gtk/valgrind.suppression" /> | ||
137 | <Unit filename="src/include/lib3270.h" /> | 138 | <Unit filename="src/include/lib3270.h" /> |
138 | <Unit filename="src/include/lib3270/action_table.h" /> | 139 | <Unit filename="src/include/lib3270/action_table.h" /> |
139 | <Unit filename="src/include/lib3270/actions.h" /> | 140 | <Unit filename="src/include/lib3270/actions.h" /> |
src/gtk/dialog.c
src/gtk/v3270/widget.c
@@ -934,7 +934,12 @@ void v3270_set_font_family(GtkWidget *widget, const gchar *name) | @@ -934,7 +934,12 @@ void v3270_set_font_family(GtkWidget *widget, const gchar *name) | ||
934 | terminal = GTK_V3270(widget); | 934 | terminal = GTK_V3270(widget); |
935 | 935 | ||
936 | if(terminal->font_family) | 936 | if(terminal->font_family) |
937 | + { | ||
938 | + if(!g_strcasecmp(terminal->font_family,name)) | ||
939 | + return; | ||
937 | g_free(terminal->font_family); | 940 | g_free(terminal->font_family); |
941 | + terminal->font_family = NULL; | ||
942 | + } | ||
938 | 943 | ||
939 | if(!name) | 944 | if(!name) |
940 | { | 945 | { |
@@ -942,11 +947,11 @@ void v3270_set_font_family(GtkWidget *widget, const gchar *name) | @@ -942,11 +947,11 @@ void v3270_set_font_family(GtkWidget *widget, const gchar *name) | ||
942 | name = "courier new"; | 947 | name = "courier new"; |
943 | } | 948 | } |
944 | 949 | ||
945 | - trace("%s(%s)",__FUNCTION__,name); | ||
946 | - | ||
947 | terminal->font_family = g_strdup(name); | 950 | terminal->font_family = g_strdup(name); |
948 | terminal->font_weight = lib3270_get_toggle(terminal->host,LIB3270_TOGGLE_BOLD) ? CAIRO_FONT_WEIGHT_BOLD : CAIRO_FONT_WEIGHT_NORMAL; | 951 | terminal->font_weight = lib3270_get_toggle(terminal->host,LIB3270_TOGGLE_BOLD) ? CAIRO_FONT_WEIGHT_BOLD : CAIRO_FONT_WEIGHT_NORMAL; |
949 | 952 | ||
953 | + trace("%s: %s (%p)",__FUNCTION__,terminal->font_family,terminal->font_family); | ||
954 | + | ||
950 | g_signal_emit(widget,v3270_widget_signal[SIGNAL_UPDATE_CONFIG], 0, "font-family", name); | 955 | g_signal_emit(widget,v3270_widget_signal[SIGNAL_UPDATE_CONFIG], 0, "font-family", name); |
951 | 956 | ||
952 | v3270_reload(widget); | 957 | v3270_reload(widget); |
@@ -958,7 +963,6 @@ void v3270_set_font_family(GtkWidget *widget, const gchar *name) | @@ -958,7 +963,6 @@ void v3270_set_font_family(GtkWidget *widget, const gchar *name) | ||
958 | const gchar * v3270_get_font_family(GtkWidget *widget) | 963 | const gchar * v3270_get_font_family(GtkWidget *widget) |
959 | { | 964 | { |
960 | g_return_val_if_fail(GTK_IS_V3270(widget),NULL); | 965 | g_return_val_if_fail(GTK_IS_V3270(widget),NULL); |
961 | - | ||
962 | return GTK_V3270(widget)->font_family; | 966 | return GTK_V3270(widget)->font_family; |
963 | } | 967 | } |
964 | 968 |
src/gtk/valgrind.suppression
ui/00default.xml
@@ -32,9 +32,18 @@ | @@ -32,9 +32,18 @@ | ||
32 | <menubar name='topmenu' topmenu='yes'> | 32 | <menubar name='topmenu' topmenu='yes'> |
33 | 33 | ||
34 | <menu name='FileMenu' label='_File' > | 34 | <menu name='FileMenu' label='_File' > |
35 | + | ||
36 | + <!--- | ||
37 | + Extended attributes for 'save' actions: | ||
38 | + | ||
39 | + * overwrite='yes' to always overwrite file | ||
40 | + * filename='PATH' to save to a predefined file (no user save dialog) | ||
41 | + | ||
42 | + ---> | ||
35 | <menuitem action='save' src='all' group='online' label='Save screen' /> | 43 | <menuitem action='save' src='all' group='online' label='Save screen' /> |
36 | <menuitem action='save' src='selected' group='selection' label='Save selected' /> | 44 | <menuitem action='save' src='selected' group='selection' label='Save selected' /> |
37 | <menuitem action='save' src='copy' group='clipboard' label='Save copy' /> | 45 | <menuitem action='save' src='copy' group='clipboard' label='Save copy' /> |
46 | + | ||
38 | <separator/> | 47 | <separator/> |
39 | <menuitem action='print' src='all' key='Print' icon='print' label='Print' /> | 48 | <menuitem action='print' src='all' key='Print' icon='print' label='Print' /> |
40 | <menuitem action='print' src='selected' group='selection' label='Print selected' /> | 49 | <menuitem action='print' src='selected' group='selection' label='Print selected' /> |
@@ -176,7 +185,7 @@ | @@ -176,7 +185,7 @@ | ||
176 | <separator /> | 185 | <separator /> |
177 | <menuitem action='backtab' label='Previous field' /> | 186 | <menuitem action='backtab' label='Previous field' /> |
178 | <menuitem action='tab' label='Next field'/> | 187 | <menuitem action='tab' label='Next field'/> |
179 | - <menuitem name="return" action='activate' label='Return' key='return' /> | 188 | + <menuitem name="return" action='activate' label='Return' key='Return' /> |
180 | 189 | ||
181 | <separator /> | 190 | <separator /> |
182 | <menuitem action='Quit'/> | 191 | <menuitem action='Quit'/> |