Age | Commit message (Collapse) | Author | Files | Lines |
|
When handling the DBus GetValue call,
ibusconfigservice.c:ibus_config_service_service_method_call()
gets a non-floating GVariant reference through
IBusConfigService::get_value() but never unrefs it.
Running ibus-dconf in valgrind and then running tests/ibus-config
shows this leak:
=28085== 232 (80 direct, 152 indirect) bytes in 2 blocks are definitely lost in loss record 2,025 of 2,121
==28085== at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28085== by 0x56EDDF2: g_malloc (gmem.c:97)
==28085== by 0x570691C: g_slice_alloc (gslice.c:1007)
==28085== by 0x572E6D9: g_variant_get_child_value (gvariant-core.c:1009)
==28085== by 0x57261C0: g_variant_get_variant (gvariant.c:715)
==28085== by 0x4C1A732: gvdb_table_value_from_item (gvdb-reader.c:578)
==28085== by 0x4C1A7A1: gvdb_table_get_value (gvdb-reader.c:610)
==28085== by 0x4C1589C: dconf_engine_read (dconf-engine.c:528)
==28085== by 0x4C14A79: dconf_client_read (dconf-client.c:242)
==28085== by 0x40286F: ibus_config_dconf_get_value (config.c:378)
==28085== by 0x4E44F29: ibus_config_service_service_method_call (ibusconfigservice.c:194)
==28085== by 0x4E33249: ibus_service_service_method_call_cb (ibusservice.c:395)
|
|
When handling the DBus SetValue call,
ibusconfigservice.c:ibus_config_service_service_method_call()
gets a GVariant through g_variant_get("(&s&sv)")
GVariant documentation says that:
« Upon encountering a 'v', g_variant_get() takes a pointer to a
(GVariant *) (ie: (GVariant **) ). It is set to a new reference to a
GVariant instance containing the contents of the variant value. It is
appropriate to free this reference using g_variant_unref(). »
so we need to unreference it when we are done with it.
Running ibus-dconf in valgrind and then running tests/ibus-config
shows this leak:
==28085== 3,934 (1,520 direct, 2,414 indirect) bytes in 38 blocks are definitely lost in loss record 2,112 of 2,121
==28085== at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28085== by 0x56EDDF2: g_malloc (gmem.c:97)
==28085== by 0x570691C: g_slice_alloc (gslice.c:1007)
==28085== by 0x572E6D9: g_variant_get_child_value (gvariant-core.c:1009)
==28085== by 0x57261C0: g_variant_get_variant (gvariant.c:715)
==28085== by 0x572BD03: g_variant_valist_get_nnp (gvariant.c:4794)
==28085== by 0x572C3F1: g_variant_valist_get_leaf (gvariant.c:4911)
==28085== by 0x572CAD4: g_variant_valist_get (gvariant.c:5092)
==28085== by 0x572CC59: g_variant_valist_get (gvariant.c:5127)
==28085== by 0x572D079: g_variant_get_va (gvariant.c:5354)
==28085== by 0x572CF9B: g_variant_get (gvariant.c:5301)
==28085== by 0x4E44E5B: ibus_config_service_service_method_call (ibusconfigservice.c:173)
|
|
Both IBusConfigDConf::get_value and IBusConfigMemconf::get_value
return a non-floating reference, so we need to be consistent in the
gconf backend and also return a non-floating reference.
|
|
IBusConfigDConf::watch_func() is roughly doing:
GVariant *variant = dconf_client_read(...)
if (variant == NULL) {
variant = g_variant_new(...);
}
ibus_config_service_value_changed(..., variant);
g_variant_unref(variant);
The problem with that is that the GVariant returned by
dconf_client_read() is non-floating while the one returned by
g_variant_new() is floating.
Since ibus_config_service_value_changed() will take ownership of
floating references, we should not unref 'variant' if it was created
through g_variant_new(), but we must call it when 'variant' is created
through dconf_client_read() or we will leak memory.
This commit fixes that by making sure we sink the reference we got
through g_variant_new().
This was sometimes causing crashes of ibus-dconf when repeatedly running
tests/ibus-config:
(ibus-dconf:24679): GLib-CRITICAL **: g_variant_unref: assertion
'value->ref_count > 0' failed
==24679== Invalid read of size 4
==24679== at 0x572E140: g_variant_unref (gvariant-core.c:625)
==24679== by 0x572DBB3: g_variant_release_children (gvariant-core.c:257)
==24679== by 0x572E202: g_variant_unref (gvariant-core.c:640)
==24679== by 0x572DBB3: g_variant_release_children (gvariant-core.c:257)
==24679== by 0x572E202: g_variant_unref (gvariant-core.c:640)
==24679== by 0x518CFDE: g_dbus_message_finalize (gdbusmessage.c:534)
==24679== by 0x5459628: g_object_unref (gobject.c:3112)
==24679== by 0x519C911: message_to_write_data_free (gdbusprivate.c:898)
==24679== by 0x519D687: write_message_cb (gdbusprivate.c:1353)
==24679== by 0x510F7F2: g_simple_async_result_complete (gsimpleasyncresult.c:763)
==24679== by 0x519CEF2: write_message_continue_writing (gdbusprivate.c:1077)
==24679== by 0x519D040: write_message_async (gdbusprivate.c:1131)
==24679== Address 0x5d8c9c4 is 36 bytes inside a block of size 40 free'd
==24679== at 0x4A07577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==24679== by 0x56EDF6B: g_free (gmem.c:190)
==24679== by 0x5706B53: g_slice_free1 (gslice.c:1112)
==24679== by 0x572E229: g_variant_unref (gvariant-core.c:643)
==24679== by 0x40240F: _watch_func (config.c:232)
==24679== by 0x3DEA605D8B: ffi_call_unix64 (in /usr/lib64/libffi.so.6.0.1)
==24679== by 0x3DEA6056BB: ffi_call (in /usr/lib64/libffi.so.6.0.1)
==24679== by 0x544EE88: g_cclosure_marshal_generic_va (gclosure.c:1541)
==24679== by 0x544D396: _g_closure_invoke_va (gclosure.c:831)
==24679== by 0x5468808: g_signal_emit_valist (gsignal.c:3215)
==24679== by 0x54699DF: g_signal_emit (gsignal.c:3363)
==24679== by 0x4C1478D: dconf_client_dispatch_change_signal (dconf-client.c:150)
|
|
ibus-engine-switch schedules an idle doing an engine switch, and
also schedules a timeout after 1 microsecond which exits the main
loop. Both of these callbacks will return FALSE, which detaches
the associated GSource from the mainloop and destroys it.
As the only way to exit the mainloop is when the timeout callback runs,
we should not try to run g_source_remove(timeout_id) as it will already
be gone, and this causes a warning.
This commit reorders a bit to make the ordering between the idle and
timeout more obvious, and it gets rid of the calls to g_source_remove()
as they are needed.
|
|
tests/ibus-config queues a timeout whose callback calls
g_main_loop_quit() before returning FALSE. After exiting the mainloop,
g_source_remove(timeout_id) is called, but if the mainloop was exited
through the timeout callback, the source will already have been removed.
This commit makes sure we only try to call g_source_remove() on that
timeout if we did not exit the mainloop through the timeout callback.
|
|
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)
|
|
"success" was misspelt "sucess"
|
|
|
|
A call to g_dbus_node_info_unref was in place but commented out.
|
|
Some functions were documented as (transfer none) instead of (transfer
full) even though the caller of the function owns the returned object.
This will cause some leaks when using gobject-introspection.
|
|
|
|
|
|
When an object contains char * properties, its deserialize function will
overwrite these string values without freeing them first. They are not
necessarily NULL as they can have (default) values set upon construction,
so they need to be g_free'd before being overwritten.
This commit introduces a ibus_g_variant_get_child_string() to do this
and set the string value.
|
|
|
|
|
|
|
|
preedit text is shown by ibus-ui-gtk3 on X11 applications
and do not have to show it likes GTK+ when the lenght is zero.
BUG=http://code.google.com/p/ibus/issues/detail?id=1709
TEST=ibus-ui-gtk3 with ibus-pinyin and x11 applications
Review URL: https://codereview.appspot.com/93150043
|
|
BUG=http://code.google.com/p/ibus/issues/detail?id=1708
Review URL: https://codereview.appspot.com/92090043
Patch from Ryu Changwoo <ryu.changwoo@gmail.com>.
|
|
BUG=http://code.google.com/p/ibus/issues/detail?id=1710
Review URL: https://codereview.appspot.com/96040043
Patch from Eike Hein <hein@kde.org>.
|
|
If GtkWindow has 'resizable' property = FALSE, the wrap in GtkLabel
is not done automatically and need to set 'max-width-chars' property.
TEST=ibus-setup
Review URL: https://codereview.appspot.com/92940043
|
|
Review URL: https://codereview.appspot.com/96800043
|
|
Review URL: https://codereview.appspot.com/96740044
|
|
Review URL: https://codereview.appspot.com/98770043
|
|
Property panel sometimes hides text entry box on firefox in case
the mode is auto-hide because firefox does not provide the right
cursor locations and firefox does not update cursor locales
when preedit is updated so property panel hides text entry box
for a while and auto-hide is not useful with firefox and thunderbird.
TEST=gsettings reset org.freedesktop.ibus.panel show
Review URL: https://codereview.appspot.com/90480043
|
|
Review URL: https://codereview.appspot.com/88850043
|
|
If /var/lib/dbus/machine-id does not exist but /etc/machine-id exists,
'error' will be set but will never be freed.
BUG=http://code.google.com/p/ibus/issues/detail?id=1701
Review URL: https://codereview.appspot.com/88770043
Patch from Christophe Fergeau <cfergeau@redhat.com>.
|
|
This is an amendment to 6ca5ddb3. As content-type (input-purpose and hints)
can change after focus-in, we should monitor the changes.
BUG=
R=takao.fujiwara1@gmail.com
Review URL: https://codereview.appspot.com/83920043
|
|
gnome-shell gets input purpose so that disables IME with password mode.
Review URL: https://codereview.appspot.com/81770044
|
|
Review URL: https://codereview.appspot.com/76830043
|
|
BUG=rhbz#1074879
Review URL: https://codereview.appspot.com/74520044
|
|
Review URL: https://codereview.appspot.com/68530043
|
|
Review URL: https://codereview.appspot.com/72000043
|
|
Update po/ja.po po/nl.po po/pl.po po/uk.po
Review URL: https://codereview.appspot.com/69920043
|
|
Review URL: https://codereview.appspot.com/69840043
|
|
Source String Contextualization Group (SSCG) is a Fedora SIG group
initiated to provide meaningful descriptions of the source strings
for translators to ensure the correctness and quality of the translations.
https://fedoraproject.org/wiki/SSCG
BUG=rhbz#1069594
Review URL: https://codereview.appspot.com/69010043
Patch from Nilamdyuti Goswami <ngoswami@redhat.com>.
|
|
Review URL: https://codereview.appspot.com/66330043
|
|
Review URL: https://codereview.appspot.com/66480044
|
|
Review URL: https://codereview.appspot.com/66450044
Patch from Julien Humbert <julroy67@gmail.com>.
|
|
Merged GTK+ translations.
Review URL: https://codereview.appspot.com/50490045
|
|
Review URL: https://codereview.appspot.com/65300043
|
|
Review URL: https://codereview.appspot.com/63750043
|
|
Review URL: https://codereview.appspot.com/60560043
|
|
Property panel sometimes is not shown when the mode is auto hide and
focus is changed between existent windows.
It's a timing issue of PropertyPanel.set_properties().
Review URL: https://codereview.appspot.com/54300049
|
|
Recently fi_FI compose table was updated in xorg/lib/libX11.
http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=20fdccd8
http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=aacf95da
BUG=rhbz#1060180
Review URL: https://codereview.appspot.com/59540043
|
|
Review URL: https://codereview.appspot.com/58930044
|
|
Reverted 729b0aa1febccbba97286f2aceb9044d907f9ffe
data/dconf/org.freedesktop.ibus.gschema.xml.in is included in tarball
so gsettings-schema-convert is not required.
BUG=http://code.google.com/p/ibus/issues/detail?id=1650
Review URL: https://codereview.appspot.com/58870044
|
|
Review URL: https://codereview.appspot.com/56510043
|
|
The default uses 'python' and if the path of python 3 is 'python3',
./configure --with-python=python3
Review URL: https://codereview.appspot.com/54930043
|
|
BUG=http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html
Review URL: https://codereview.appspot.com/55480044
|