diff options
author | fluxgen <fluxgen> | 2004-01-09 02:17:46 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-01-09 02:17:46 (GMT) |
commit | a86e7f8d54fa69cfb781f52c9f526f44da5d3504 (patch) | |
tree | 73cdd1bbbe3790485f53d18a7adb372e60cc93b1 /src/Shape.cc | |
parent | a944c7cca4c8aa9b3366e1b2bdef176f01b5a73a (diff) | |
download | fluxbox-a86e7f8d54fa69cfb781f52c9f526f44da5d3504.zip fluxbox-a86e7f8d54fa69cfb781f52c9f526f44da5d3504.tar.bz2 |
calloc for consisten alloc/free with XDestroyImage, makes valgrind happy
Diffstat (limited to 'src/Shape.cc')
-rw-r--r-- | src/Shape.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Shape.cc b/src/Shape.cc index b4ac635..76cac96 100644 --- a/src/Shape.cc +++ b/src/Shape.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: Shape.cc,v 1.7 2003/10/06 06:22:42 rathnor Exp $ | 22 | // $Id: Shape.cc,v 1.8 2004/01/09 02:17:46 fluxgen Exp $ |
23 | 23 | ||
24 | #include "Shape.hh" | 24 | #include "Shape.hh" |
25 | #include "FbTk/FbWindow.hh" | 25 | #include "FbTk/FbWindow.hh" |
@@ -57,7 +57,9 @@ Pixmap createShape(FbTk::FbWindow &win, int place) { | |||
57 | 57 | ||
58 | Display *disp = FbTk::App::instance()->display(); | 58 | Display *disp = FbTk::App::instance()->display(); |
59 | const size_t data_size = win_width * win_height; | 59 | const size_t data_size = win_width * win_height; |
60 | char *data = new char[data_size]; | 60 | // we use calloc here so we get consistent C alloc/free with XDestroyImage |
61 | // and no warnings in valgrind :) | ||
62 | char *data = (char *)calloc(data_size, sizeof (char)); | ||
61 | memset(data, 0xFF, data_size); | 63 | memset(data, 0xFF, data_size); |
62 | 64 | ||
63 | XImage *ximage = XCreateImage(disp, | 65 | XImage *ximage = XCreateImage(disp, |