summaryrefslogtreecommitdiffstats
path: root/src/display/nr-style.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-04-09 01:46:06 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-04-09 01:46:06 +0000
commit3e80b896214d68d84a475b0c780f6770ad6ae397 (patch)
tree70c9176760aefed532818ad588c8a1416d68ab7c /src/display/nr-style.cpp
parentSlightly improve EXTRACT_ARGB32 macro (diff)
downloadinkscape-3e80b896214d68d84a475b0c780f6770ad6ae397.tar.gz
inkscape-3e80b896214d68d84a475b0c780f6770ad6ae397.zip
Initialize cached patterns to NULL in NRStyle, should fix crashes
(bzr r9508.1.80)
Diffstat (limited to 'src/display/nr-style.cpp')
-rw-r--r--src/display/nr-style.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/display/nr-style.cpp b/src/display/nr-style.cpp
index 40366f5d3..72fa0c444 100644
--- a/src/display/nr-style.cpp
+++ b/src/display/nr-style.cpp
@@ -51,6 +51,8 @@ NRStyle::NRStyle()
, fill_rule(CAIRO_FILL_RULE_EVEN_ODD)
, line_cap(CAIRO_LINE_CAP_BUTT)
, line_join(CAIRO_LINE_JOIN_MITER)
+ , fill_pattern(NULL)
+ , stroke_pattern(NULL)
{}
NRStyle::~NRStyle()
@@ -198,8 +200,8 @@ void NRStyle::applyStroke(cairo_t *ct)
void NRStyle::update()
{
// force pattern update
- cairo_pattern_destroy(fill_pattern);
- cairo_pattern_destroy(stroke_pattern);
+ if (fill_pattern) cairo_pattern_destroy(fill_pattern);
+ if (stroke_pattern) cairo_pattern_destroy(stroke_pattern);
fill_pattern = NULL;
stroke_pattern = NULL;
}