diff options
-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, |