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

Issue 400009: GTK: fix link button double free.... (Closed)

Created:
11 years, 1 month ago by Evan Stade
Modified:
9 years, 6 months ago
Reviewers:
Evan Martin
CC:
chromium-reviews_googlegroups.com, ben+cc_chromium.org
Visibility:
Public.

Description

GTK: fix link button double free. If set_normal_color was called while native_markup == normal_markup, then the string could be double freed. To fix this problem and prevent similar future mistakes, I made native_markup stdup normal_markup instead of just copying the pointer (the optimization wasn't worth the trickiness). Also, I cleaned up destruction logic. BUG=27855 TEST=tried every flavor of chrome link button: - classic theme - non classic theme - gtk theme - gtk theme system theme that has non-default link text color property

Patch Set 1 #

Total comments: 3

Patch Set 2 : g_ everything #

Patch Set 3 : g_strdup_printf #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -47 lines) Patch
M chrome/browser/gtk/gtk_chrome_link_button.cc View 1 2 7 chunks +27 lines, -47 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Evan Stade
11 years, 1 month ago (2009-11-17 02:56:35 UTC) #1
Evan Martin
http://codereview.chromium.org/400009/diff/1/2 File chrome/browser/gtk/gtk_chrome_link_button.cc (right): http://codereview.chromium.org/400009/diff/1/2#newcode45 Line 45: free(button->text); g_free for consistency http://codereview.chromium.org/400009/diff/1/2#newcode101 Line 101: button->native_markup ...
11 years, 1 month ago (2009-11-17 03:00:37 UTC) #2
Evan Martin
OK
11 years, 1 month ago (2009-11-17 03:02:52 UTC) #3
Evan Stade
11 years, 1 month ago (2009-11-17 03:12:03 UTC) #4
updated again to use g_strdup_printf, committing when (if) tree opens

Powered by Google App Engine
This is Rietveld 408576698