summaryrefslogtreecommitdiff
path: root/src/Fl_Pixmap.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-08-05 17:50:25 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-08-05 17:50:25 +0000
commita11a31ff78af62e73735b5e012849523a612e26a (patch)
tree539acb40340746b970e5f151def2ae9105b8821d /src/Fl_Pixmap.cxx
parent685100b1222821dedec2e0b22f55ca18027a99df (diff)
Range check Fl_Text_Buffer::search_forward().
Don't use png_read_destroy() - it doesn't free all memory. Add uncache() method to image classes. Memory/initialization bugs in Fl_File_Chooser (valgrind) Make sure both Fl_Window constructors have default cursor initialization code... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2562 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Pixmap.cxx')
-rw-r--r--src/Fl_Pixmap.cxx39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx
index ab7308e75..889b1ecc8 100644
--- a/src/Fl_Pixmap.cxx
+++ b/src/Fl_Pixmap.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.19 2002/06/29 00:10:04 matthiaswm Exp $"
+// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.20 2002/08/05 17:50:25 easysw Exp $"
//
// Pixmap drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -146,11 +146,22 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
}
Fl_Pixmap::~Fl_Pixmap() {
- if (id) fl_delete_offscreen(id);
- if (mask) fl_delete_bitmask(mask);
+ uncache();
delete_data();
}
+void Fl_Pixmap::uncache() {
+ if (id) {
+ fl_delete_offscreen(id);
+ id = 0;
+ }
+
+ if (mask) {
+ fl_delete_bitmask(mask);
+ mask = 0;
+ }
+}
+
void Fl_Pixmap::label(Fl_Widget* w) {
w->image(this);
}
@@ -302,15 +313,7 @@ Fl_Image *Fl_Pixmap::copy(int W, int H) {
void Fl_Pixmap::color_average(Fl_Color c, float i) {
// Delete any existing pixmap/mask objects...
- if (id) {
- fl_delete_offscreen(id);
- id = 0;
- }
-
- if (mask) {
- fl_delete_bitmask(mask);
- mask = 0;
- }
+ uncache();
// Allocate memory as needed...
copy_data();
@@ -402,15 +405,7 @@ void Fl_Pixmap::set_data(const char * const * p) {
void Fl_Pixmap::desaturate() {
// Delete any existing pixmap/mask objects...
- if (id) {
- fl_delete_offscreen(id);
- id = 0;
- }
-
- if (mask) {
- fl_delete_bitmask(mask);
- mask = 0;
- }
+ uncache();
// Allocate memory as needed...
copy_data();
@@ -465,5 +460,5 @@ void Fl_Pixmap::desaturate() {
}
//
-// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.19 2002/06/29 00:10:04 matthiaswm Exp $".
+// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.20 2002/08/05 17:50:25 easysw Exp $".
//