diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2010-10-17 22:12:45 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2010-10-17 22:12:45 +0200 |
commit | 9e7f46acf51ab4dd0c3e0e1c2d7dcb47d4e709e9 (patch) | |
tree | 3c0a6f8f9bb8ad8bf356bd84ddad52d535007ae8 /dw | |
parent | 6c7f9bd1398482e9098c8495dc2c5f13e771a865 (diff) |
first ref(), then unref() in Layout::setBgColor()
In case new and old bgColor are the same thing, we need to avoid to
delete bgColor by first unref()ing it.
Diffstat (limited to 'dw')
-rw-r--r-- | dw/layout.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dw/layout.cc b/dw/layout.cc index 1835ab96..e33da4d1 100644 --- a/dw/layout.cc +++ b/dw/layout.cc @@ -611,11 +611,13 @@ void Layout::updateCursor () void Layout::setBgColor (style::Color *color) { + color->ref (); + if (bgColor) bgColor->unref (); bgColor = color; - bgColor->ref (); + if (view) view->setBgColor (bgColor); } |