aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/FbPixmap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/FbPixmap.cc')
-rw-r--r--src/FbTk/FbPixmap.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc
index c605feb..46ee97c 100644
--- a/src/FbTk/FbPixmap.cc
+++ b/src/FbTk/FbPixmap.cc
@@ -54,18 +54,18 @@ Atom FbPixmap::root_prop_atoms[] = {
54 54
55FbPixmap::FbPixmap():m_pm(0), 55FbPixmap::FbPixmap():m_pm(0),
56 m_width(0), m_height(0), 56 m_width(0), m_height(0),
57 m_depth(0) { 57 m_depth(0), m_dont_free(false) {
58} 58}
59 59
60FbPixmap::FbPixmap(const FbPixmap &the_copy):FbDrawable(), m_pm(0), 60FbPixmap::FbPixmap(const FbPixmap &the_copy):FbDrawable(), m_pm(0),
61 m_width(0), m_height(0), 61 m_width(0), m_height(0),
62 m_depth(0){ 62 m_depth(0), m_dont_free(false) {
63 copy(the_copy); 63 copy(the_copy);
64} 64}
65 65
66FbPixmap::FbPixmap(Pixmap pm):m_pm(0), 66FbPixmap::FbPixmap(Pixmap pm):m_pm(0),
67 m_width(0), m_height(0), 67 m_width(0), m_height(0),
68 m_depth(0) { 68 m_depth(0), m_dont_free(false) {
69 if (pm == 0) 69 if (pm == 0)
70 return; 70 return;
71 // assign X pixmap to this 71 // assign X pixmap to this
@@ -76,7 +76,7 @@ FbPixmap::FbPixmap(const FbDrawable &src,
76 unsigned int width, unsigned int height, 76 unsigned int width, unsigned int height,
77 unsigned int depth):m_pm(0), 77 unsigned int depth):m_pm(0),
78 m_width(0), m_height(0), 78 m_width(0), m_height(0),
79 m_depth(0) { 79 m_depth(0), m_dont_free(false) {
80 80
81 create(src.drawable(), width, height, depth); 81 create(src.drawable(), width, height, depth);
82} 82}
@@ -85,7 +85,7 @@ FbPixmap::FbPixmap(Drawable src,
85 unsigned int width, unsigned int height, 85 unsigned int width, unsigned int height,
86 unsigned int depth):m_pm(0), 86 unsigned int depth):m_pm(0),
87 m_width(0), m_height(0), 87 m_width(0), m_height(0),
88 m_depth(0) { 88 m_depth(0), m_dont_free(false) {
89 89
90 create(src, width, height, depth); 90 create(src, width, height, depth);
91} 91}
@@ -470,10 +470,13 @@ void FbPixmap::checkAtoms() {
470} 470}
471 471
472void FbPixmap::free() { 472void FbPixmap::free() {
473 if (m_pm != 0) { 473 if (!m_dont_free && m_pm != 0)
474 XFreePixmap(display(), m_pm); 474 XFreePixmap(display(), m_pm);
475 m_pm = 0; 475
476 } 476 /* note: m_dont_free shouldnt be required anywhere else,
477 because then free() isn't being called appropriately! */
478 m_dont_free = false;
479 m_pm = 0;
477 m_width = 0; 480 m_width = 0;
478 m_height = 0; 481 m_height = 0;
479 m_depth = 0; 482 m_depth = 0;