diff options
author | joye <joye> | 2014-04-18 19:06:17 (GMT) |
---|---|---|
committer | joye <joye> | 2014-04-18 19:06:17 (GMT) |
commit | 31056536d6c5d29bd07df8c3bcae9dde8342d497 (patch) | |
tree | 9c01a279c8e193686acd5ff06ad387d6cce0e1b7 /src/bltGrElem.C | |
parent | 1c0ee170a39938089568f5ad22be530e6a52a773 (diff) | |
download | blt-31056536d6c5d29bd07df8c3bcae9dde8342d497.zip blt-31056536d6c5d29bd07df8c3bcae9dde8342d497.tar.gz blt-31056536d6c5d29bd07df8c3bcae9dde8342d497.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src/bltGrElem.C')
-rw-r--r-- | src/bltGrElem.C | 16 |
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); } } |