Use memory allocator correctly.
This commit is contained in:
parent
8d54d22cb2
commit
8d361eee22
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user