Nux

Merge lp:~brandontschaefer/nux/fix-mem-leak-preedit-update into lp:nux

Proposed by Brandon Schaefer
Status: Merged
Approved by: Brandon Schaefer
Approved revision: 624
Merged at revision: 624
Proposed branch: lp:~brandontschaefer/nux/fix-mem-leak-preedit-update
Merge into: lp:nux
Diff against target: 15 lines (+5/-0)
1 file modified
Nux/InputMethodIBus.cpp (+5/-0)
To merge this branch: bzr merge lp:~brandontschaefer/nux/fix-mem-leak-preedit-update
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+111529@code.launchpad.net

Commit message

Fix memory leak in InputMethdIBus::OnPreeditUpdate.

Description of the change

=== Problem ===
Each time the ibus preedit is updated it gets a new pango attrs list and the old one was not getting deleted.

=== Fix ===
Now it does!!

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

+1

review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

No commit message specified.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Nux/InputMethodIBus.cpp'
2--- Nux/InputMethodIBus.cpp 2012-04-19 22:57:27 +0000
3+++ Nux/InputMethodIBus.cpp 2012-06-22 02:18:19 +0000
4@@ -278,6 +278,11 @@
5 pango_attr->end_index = g_utf8_offset_to_pointer (text->text, attr->end_index) - text->text;
6 pango_attr_list_insert (preedit_attrs, pango_attr);
7 }
8+ if (text_entry_->preedit_attrs_)
9+ {
10+ pango_attr_list_unref(text_entry_->preedit_attrs_);
11+ text_entry_->preedit_attrs_ = NULL;
12+ }
13 text_entry_->preedit_attrs_ = preedit_attrs;
14 }
15 if (text->text)

Subscribers

People subscribed via source and target branches