all repos — fluxbox @ a86e7f8d54fa69cfb781f52c9f526f44da5d3504

custom fork of the fluxbox windowmanager

calloc for consisten alloc/free with XDestroyImage, makes valgrind happy
fluxgen fluxgen
commit

a86e7f8d54fa69cfb781f52c9f526f44da5d3504

parent

a944c7cca4c8aa9b3366e1b2bdef176f01b5a73a

1 files changed, 4 insertions(+), 2 deletions(-)

jump to
M src/Shape.ccsrc/Shape.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Shape.cc,v 1.7 2003/10/06 06:22:42 rathnor Exp $ +// $Id: Shape.cc,v 1.8 2004/01/09 02:17:46 fluxgen Exp $ #include "Shape.hh" #include "FbTk/FbWindow.hh"

@@ -57,7 +57,9 @@ const int pixmap_height = min(8, win_height);

Display *disp = FbTk::App::instance()->display(); const size_t data_size = win_width * win_height; - char *data = new char[data_size]; + // we use calloc here so we get consistent C alloc/free with XDestroyImage + // and no warnings in valgrind :) + char *data = (char *)calloc(data_size, sizeof (char)); memset(data, 0xFF, data_size); XImage *ximage = XCreateImage(disp,