Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(80)

Issue 104850044: Fix GVariantBuilder leaks (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 8 months ago by fujiwara
Modified:
11 years, 8 months ago
Reviewers:
shawn.p.huang, Peng
CC:
shawn.p.huang_gmail.com, fujiwara, cfergeau_redhat.com
Base URL:
git://github.com/ibus/ibus.git@master
Visibility:
Public.

Description

Fix GVariantBuilder leaks When using g_variant_builder_new(), we must call g_variant_builder_unref() to free it: "You should call g_variant_builder_unref() on the return value when it is no longer needed. The memory will not be automatically freed by any other call. In most cases it is easier to place a GVariantBuilder directly on the stack of the calling function and initialise it with g_variant_builder_init()." One of these leaks showed up in valgrind as: ==20702== 16,416 bytes in 114 blocks are definitely lost in loss record 2,114 of 2,115 ==20702== at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==20702== by 0x56EDDF2: g_malloc (gmem.c:97) ==20702== by 0x570691C: g_slice_alloc (gslice.c:1007) ==20702== by 0x5729743: g_variant_builder_new (gvariant.c:3169) ==20702== by 0x40297B: ibus_config_dconf_get_values (config.c:413) ==20702== by 0x4E44FF2: ibus_config_service_service_method_call (ibusconfigservice.c:214) ==20702== by 0x4E33249: ibus_service_service_method_call_cb (ibusservice.c:395) ==20702== by 0x51880D8: call_in_idle_cb (gdbusconnection.c:4875) ==20702== by 0x56E81D7: g_idle_dispatch (gmain.c:5319) ==20702== by 0x56E58F1: g_main_dispatch (gmain.c:3064) ==20702== by 0x56E6667: g_main_context_dispatch (gmain.c:3663) ==20702== by 0x56E6859: g_main_context_iterate (gmain.c:3734) BUG=http://code.google.com/p/ibus/issues/detail?id=1712

Patch Set 1 #

Patch Set 2 : Updated with the latest master. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -10 lines) Patch
M bus/ibusimpl.c View 1 chunk +1 line, -0 lines 0 comments Download
M bus/inputcontext.c View 1 chunk +4 lines, -3 lines 0 comments Download
M conf/dconf/config.c View 4 chunks +4 lines, -4 lines 0 comments Download
M conf/gconf/config.c View 1 chunk +5 lines, -3 lines 0 comments Download
M src/ibuscomponent.c View 1 2 chunks +2 lines, -0 lines 0 comments Download
M src/ibusengine.c View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 2
fujiwara
11 years, 8 months ago (2014-06-04 07:53:38 UTC) #1
Peng
11 years, 8 months ago (2014-06-05 14:31:02 UTC) #2
thanks for fixing. LGTM
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b