diff --git a/src/nvimage/Image.cpp b/src/nvimage/Image.cpp index 77f7bc8..6676a13 100644 --- a/src/nvimage/Image.cpp +++ b/src/nvimage/Image.cpp @@ -39,10 +39,9 @@ const Image & Image::operator=(const Image & img) void Image::allocate(uint w, uint h) { - free(); m_width = w; m_height = h; - m_data = (Color32 *)nv::mem::malloc(w * h * sizeof(Color32)); + m_data = (Color32 *)nv::mem::realloc(m_data, w * h * sizeof(Color32)); } bool Image::load(const char * name) @@ -80,7 +79,7 @@ void Image::unwrap() void Image::free() { - ::free(m_data); + nv::mem::free(m_data); m_data = NULL; }