RESOLVED FIXED 55989
[GTK] Possible leaks after splitting TextCheckerClientEnchant.
https://bugs.webkit.org/show_bug.cgi?id=55989
Summary [GTK] Possible leaks after splitting TextCheckerClientEnchant.
Ryuan Choi
Reported 2011-03-08 18:09:11 PST
I removed g_free(ctext); in Bug 51587, but I am missing to change it's type.
Attachments
Patch (2.40 KB, patch)
2011-03-08 18:17 PST, Ryuan Choi
no flags
simplechanges (2.99 KB, patch)
2011-03-08 21:59 PST, Ryuan Choi
no flags
simplechanges (3.12 KB, patch)
2011-03-08 22:04 PST, Ryuan Choi
no flags
Patch (3.23 KB, patch)
2011-03-12 00:33 PST, Ryuan Choi
no flags
Ryuan Choi
Comment 1 2011-03-08 18:17:57 PST
Martin Robinson
Comment 2 2011-03-08 21:34:49 PST
Comment on attachment 85121 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=85121&action=review Thanks for fixing this. > Source/WebKit/gtk/WebCoreSupport/TextCheckerClientEnchant.cpp:81 > + int utflen = g_utf8_strlen(ctext.get(), -1); Please change ctext to utf8Text and utflen to utf8Length. I know that you didn't add this code, but utflen makes no sense at all. :)
Ryuan Choi
Comment 3 2011-03-08 21:59:20 PST
Created attachment 85131 [details] simplechanges
Ryuan Choi
Comment 4 2011-03-08 22:01:27 PST
(In reply to comment #2) > (From update of attachment 85121 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=85121&action=review > > Thanks for fixing this. > > > Source/WebKit/gtk/WebCoreSupport/TextCheckerClientEnchant.cpp:81 > > + int utflen = g_utf8_strlen(ctext.get(), -1); > > Please change ctext to utf8Text and utflen to utf8Length. I know that you didn't add this code, but utflen makes no sense at all. :) I changed as you mentioned. Additionally I fixed some coding style and removed remained g_free.
Ryuan Choi
Comment 5 2011-03-08 22:04:22 PST
Created attachment 85132 [details] simplechanges
Collabora GTK+ EWS bot
Comment 6 2011-03-08 23:05:38 PST
Martin Robinson
Comment 7 2011-03-09 13:32:16 PST
Comment on attachment 85132 [details] simplechanges View in context: https://bugs.webkit.org/attachment.cgi?id=85132&action=review Thanks for continuing to clean this code up! I really appreciate it. I've one suggested change. > Source/WebKit/gtk/WebCoreSupport/TextCheckerClientEnchant.cpp:113 > + g_utf8_strncpy(word.get(), cstart, end - start); We've already calculated the final offset here, why not do this: CString word(cstart, bytes); int result = enchant_dict_check(dict, word.data(), -1);
Ryuan Choi
Comment 8 2011-03-12 00:33:30 PST
Ryuan Choi
Comment 9 2011-03-12 00:41:42 PST
(In reply to comment #7) > (From update of attachment 85132 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=85132&action=review > > Thanks for continuing to clean this code up! I really appreciate it. I've one suggested change. > > > Source/WebKit/gtk/WebCoreSupport/TextCheckerClientEnchant.cpp:113 > > + g_utf8_strncpy(word.get(), cstart, end - start); > > We've already calculated the final offset here, why not do this: > > CString word(cstart, bytes); > int result = enchant_dict_check(dict, word.data(), -1); Personally, it's my pleasure to contribute something for WebKit and get your review. I update patch as you mentioned. Additionally, I thought that some logic will be moved out of nested for loop because it looks not changed in nested for loop.
Martin Robinson
Comment 10 2011-03-13 00:29:09 PST
Comment on attachment 85576 [details] Patch Thanks! Great cleanup.
WebKit Commit Bot
Comment 11 2011-03-13 13:18:16 PDT
Comment on attachment 85576 [details] Patch Rejecting attachment 85576 [details] from commit-queue. Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=cr-jail-3', 'build-..." exit_code: 2 Last 500 characters of output: ...................................... tables/mozilla_expected_failures/other .. transforms .... transforms/2d ............ transforms/3d/general ..... transforms/3d/hit-testing .... transforms/3d/point-mapping ........ transitions ................. transitions/interrupted-accelerated-transition.html -> failed Exiting early after 1 failures. 21676 tests run. 525.42s total testing time 21675 test cases (99%) succeeded 1 test case (<1%) had incorrect layout 13 test cases (<1%) had stderr output Full output: http://queues.webkit.org/results/8175073
Ryuan Choi
Comment 12 2011-03-13 18:41:40 PDT
Hmm. I don't know why that test case was failed. I tested in my PC, but It looks OK like below. root@ryuan2-desktop:/workspace/gtk_webkit# WebKitBuild/Release/Programs/DumpRenderTree LayoutTests/transitions/interrupted-accelerated-transition.html main frame - has 1 onunload handler(s) PASS - "opacity" property for "box" element at 0.5s saw something close to: 0.5 #EOF Can I know how to reproduce?
Martin Robinson
Comment 13 2011-03-14 13:37:53 PDT
I'm pretty sure this patch is unrelated to that failure. Probaly the test is just flaky. I'll flip the bit again.
WebKit Commit Bot
Comment 14 2011-03-14 20:50:50 PDT
Comment on attachment 85576 [details] Patch Clearing flags on attachment: 85576 Committed r81102: <http://trac.webkit.org/changeset/81102>
WebKit Commit Bot
Comment 15 2011-03-14 20:50:56 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.