summaryrefslogtreecommitdiffstats
path: root/src/bltGrElem.C
diff options
context:
space:
mode:
authorjoye <joye>2014-04-18 19:06:17 (GMT)
committerjoye <joye>2014-04-18 19:06:17 (GMT)
commit31056536d6c5d29bd07df8c3bcae9dde8342d497 (patch)
tree9c01a279c8e193686acd5ff06ad387d6cce0e1b7 /src/bltGrElem.C
parent1c0ee170a39938089568f5ad22be530e6a52a773 (diff)
downloadblt-31056536d6c5d29bd07df8c3bcae9dde8342d497.zip
blt-31056536d6c5d29bd07df8c3bcae9dde8342d497.tar.gz
blt-31056536d6c5d29bd07df8c3bcae9dde8342d497.tar.bz2
*** empty log message ***
Diffstat (limited to 'src/bltGrElem.C')
-rw-r--r--src/bltGrElem.C16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/bltGrElem.C b/src/bltGrElem.C
index c7ae0e6..cd249df 100644
--- a/src/bltGrElem.C
+++ b/src/bltGrElem.C
@@ -125,6 +125,15 @@ PenStyle** Element::StyleMap()
return dataToStyle;
}
+void Element::freePen(Pen* penPtr)
+{
+ if (penPtr != NULL) {
+ penPtr->refCount_--;
+ if (penPtr->refCount_ == 0)
+ delete penPtr;
+ }
+}
+
void Blt_FreeStylePalette(Blt_Chain stylePalette)
{
// Skip the first slot. It contains the built-in "normal" pen of the element
@@ -134,7 +143,12 @@ void Blt_FreeStylePalette(Blt_Chain stylePalette)
for (link = Blt_Chain_NextLink(link); link != NULL; link = next) {
next = Blt_Chain_NextLink(link);
PenStyle *stylePtr = (PenStyle*)Blt_Chain_GetValue(link);
- Blt_FreePen(stylePtr->penPtr);
+ Pen* penPtr = stylePtr->penPtr;
+ if (penPtr) {
+ penPtr->refCount_--;
+ if (penPtr->refCount_ == 0)
+ delete penPtr;
+ }
Blt_Chain_DeleteLink(stylePalette, link);
}
}