changeset 1745:5098b7291738

refcount Layout::bgColor
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Sun, 17 Oct 2010 18:09:22 +0200
parents 49340e0f3414
children ef983c0fe908
files dw/layout.cc
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dw/layout.cc	Sun Oct 17 17:49:10 2010 +0200
+++ b/dw/layout.cc	Sun Oct 17 18:09:22 2010 +0200
@@ -223,7 +223,8 @@
       platform->removeIdle (scrollIdleId);
    if (resizeIdleId != -1)
       platform->removeIdle (resizeIdleId);
-
+   if (bgColor)
+      bgColor->unref ();
    if (topLevel)
       delete topLevel;
    delete platform;
@@ -610,7 +611,11 @@
 
 void Layout::setBgColor (style::Color *color)
 {
+   if (bgColor)
+      bgColor->unref ();
+
    bgColor = color;
+   bgColor->ref ();
    if (view)
       view->setBgColor (bgColor);
 }