Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: src/IBusChewingEngine.gob

Issue 668239: Fix memory errors in third_party/ibus-chewing/files/src. (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IBusChewingEngine.gob
diff --git a/src/IBusChewingEngine.gob b/src/IBusChewingEngine.gob
index 7a1c075824f16e002cc0b70fb30e375c857a52df..9dda2a4d5a218b499c138dae66e41fa14e65f707 100644
--- a/src/IBusChewingEngine.gob
+++ b/src/IBusChewingEngine.gob
@@ -275,9 +275,10 @@ class IBus:Chewing:Engine from IBus:Engine{
G_DEBUG_MSG(3,"[I3] load_setting()");
int i;
gchar buf[BUFFER_SIZE_LOCAL];
- GValue gValue={0};
for (i=0; propSpecs[i].valueType!=G_TYPE_INVALID;i++){
+ GValue gValue={0};
+
G_DEBUG_MSG(4,"[I4] load_setting(), i=%d",i);
if (ibus_config_get_value(self->config, "engine/Chewing",propSpecs[i].key, &gValue)){
switch(propSpecs[i].valueType){
@@ -316,7 +317,9 @@ class IBus:Chewing:Engine from IBus:Engine{
/* Add property to dialog */
maker_dialog_add_property(MAKER_DIALOG(self->setting_dialog),&propSpecs[i],buf,self);
maker_dialog_apply_widget_value(MAKER_DIALOG(self->setting_dialog),propSpecs[i].key);
- g_value_unset(&gValue);
+ if (G_IS_VALUE(&gValue)) {
+ g_value_unset(&gValue);
+ }
}
for (i=0; page_labels[i]!=NULL;i++){
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698