Merge lp:~toabctl/overlay-scrollbar/fix-1058205-for-ubuntu into lp:~ubuntu-desktop/overlay-scrollbar/ubuntu

Proposed by Thomas Bechtold
Status: Merged
Merged at revision: 200
Proposed branch: lp:~toabctl/overlay-scrollbar/fix-1058205-for-ubuntu
Merge into: lp:~ubuntu-desktop/overlay-scrollbar/ubuntu
Diff against target: 164 lines (+71/-48)
2 files modified
debian/changelog (+6/-0)
os/os-scrollbar.c (+65/-48)
To merge this branch: bzr merge lp:~toabctl/overlay-scrollbar/fix-1058205-for-ubuntu
Reviewer Review Type Date Requested Status
Ubuntu Desktop Pending
Review via email: mp+128099@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2012-09-25 11:13:24 +0000
+++ debian/changelog 2012-10-04 19:44:21 +0000
@@ -1,3 +1,9 @@
1overlay-scrollbar (0.2.16+r357-0ubuntu1) UNRELEASED; urgency=low
2
3 * Updated to r357, fixes memory leak (lp: #1058205)
4
5 -- Thomas Bechtold <thomasbechtold@jpberlin.de> Thu, 04 Oct 2012 21:36:57 +0200
6
1overlay-scrollbar (0.2.16+r356-0ubuntu2) quantal-proposed; urgency=low7overlay-scrollbar (0.2.16+r356-0ubuntu2) quantal-proposed; urgency=low
28
3 * Reuploaded now that gtk2 has a fix for it9 * Reuploaded now that gtk2 has a fix for it
410
=== modified file 'os/os-scrollbar.c'
--- os/os-scrollbar.c 2012-09-24 14:25:40 +0000
+++ os/os-scrollbar.c 2012-10-04 19:44:21 +0000
@@ -609,14 +609,28 @@
609}609}
610#endif610#endif
611611
612/* Get the private struct. */612/* destroy the private struct */
613static void
614destroy_private (gpointer priv)
615{
616 g_slice_free (OsScrollbarPrivate, priv);
617}
618
619/* Get the private struct. If there isn't one, return NULL */
620static OsScrollbarPrivate*
621lookup_private (GtkWidget *widget)
622{
623 return g_object_get_qdata (G_OBJECT (widget), os_quark_qdata);
624}
625
626/* Get the private struct. If there isn't one, create it */
613static OsScrollbarPrivate*627static OsScrollbarPrivate*
614get_private (GtkWidget *widget)628get_private (GtkWidget *widget)
615{629{
616 OsScrollbarPrivate *priv;630 OsScrollbarPrivate *priv;
617631
618 /* Fetch the private qdata struct. */632 /* Fetch the private qdata struct. */
619 priv = g_object_get_qdata (G_OBJECT (widget), os_quark_qdata);633 priv = lookup_private (widget);
620634
621 if (!priv)635 if (!priv)
622 {636 {
@@ -667,7 +681,7 @@
667 scrolling_cb, scrolling_end_cb, widget);681 scrolling_cb, scrolling_end_cb, widget);
668682
669 /* Store qdata. */683 /* Store qdata. */
670 g_object_set_qdata (G_OBJECT (widget), os_quark_qdata, qdata);684 g_object_set_qdata_full (G_OBJECT (widget), os_quark_qdata, qdata, destroy_private);
671 priv = qdata;685 priv = qdata;
672686
673 /* Create adjustment and thumb. */687 /* Create adjustment and thumb. */
@@ -3175,31 +3189,6 @@
3175 OsScrollbarPrivate *priv;3189 OsScrollbarPrivate *priv;
31763190
3177 scrollbar = GTK_SCROLLBAR (object);3191 scrollbar = GTK_SCROLLBAR (object);
3178 priv = get_private (GTK_WIDGET (scrollbar));
3179
3180 if (priv->source_deactivate_bar_id != 0)
3181 {
3182 g_source_remove (priv->source_deactivate_bar_id);
3183 priv->source_deactivate_bar_id = 0;
3184 }
3185
3186 if (priv->source_hide_thumb_id != 0)
3187 {
3188 g_source_remove (priv->source_hide_thumb_id);
3189 priv->source_hide_thumb_id = 0;
3190 }
3191
3192 if (priv->source_show_thumb_id != 0)
3193 {
3194 g_source_remove (priv->source_show_thumb_id);
3195 priv->source_show_thumb_id = 0;
3196 }
3197
3198 if (priv->source_unlock_thumb_id != 0)
3199 {
3200 g_source_remove (priv->source_unlock_thumb_id);
3201 priv->source_unlock_thumb_id = 0;
3202 }
32033192
3204 os_root_list = g_slist_remove (os_root_list, scrollbar);3193 os_root_list = g_slist_remove (os_root_list, scrollbar);
32053194
@@ -3215,26 +3204,54 @@
3215 root_filter_func, NULL);3204 root_filter_func, NULL);
3216 }3205 }
32173206
3218 if (priv->animation != NULL)3207 priv = lookup_private (GTK_WIDGET(scrollbar));
3219 {3208 if (priv != NULL)
3220 g_object_unref (priv->animation);3209 {
3221 priv->animation = NULL;3210 if (priv->source_deactivate_bar_id != 0)
3222 }3211 {
32233212 g_source_remove (priv->source_deactivate_bar_id);
3224 if (priv->bar != NULL)3213 priv->source_deactivate_bar_id = 0;
3225 {3214 }
3226 g_object_unref (priv->bar);3215
3227 priv->bar = NULL;3216 if (priv->source_hide_thumb_id != 0)
3228 }3217 {
32293218 g_source_remove (priv->source_hide_thumb_id);
3230 if (priv->window_group != NULL)3219 priv->source_hide_thumb_id = 0;
3231 {3220 }
3232 g_object_unref (priv->window_group);3221
3233 priv->window_group = NULL;3222 if (priv->source_show_thumb_id != 0)
3234 }3223 {
32353224 g_source_remove (priv->source_show_thumb_id);
3236 swap_adjustment (scrollbar, NULL);3225 priv->source_show_thumb_id = 0;
3237 swap_thumb (scrollbar, NULL);3226 }
3227
3228 if (priv->source_unlock_thumb_id != 0)
3229 {
3230 g_source_remove (priv->source_unlock_thumb_id);
3231 priv->source_unlock_thumb_id = 0;
3232 }
3233
3234 if (priv->animation != NULL)
3235 {
3236 g_object_unref (priv->animation);
3237 priv->animation = NULL;
3238 }
3239
3240 if (priv->bar != NULL)
3241 {
3242 g_object_unref (priv->bar);
3243 priv->bar = NULL;
3244 }
3245
3246 if (priv->window_group != NULL)
3247 {
3248 g_object_unref (priv->window_group);
3249 priv->window_group = NULL;
3250 }
3251
3252 swap_adjustment (scrollbar, NULL);
3253 swap_thumb (scrollbar, NULL);
3254 }
3238 }3255 }
32393256
3240 (* pre_hijacked_scrollbar_dispose) (object);3257 (* pre_hijacked_scrollbar_dispose) (object);

Subscribers

People subscribed via source and target branches