summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/image
diff options
context:
space:
mode:
authorschodet2005-03-27 20:01:45 +0000
committerschodet2005-03-27 20:01:45 +0000
commit84e7664513cdec1b23d505da95bd663b465b453e (patch)
treeeb582b14a1b380283a0b4cecd5dd3243466f6d65 /2005/i/robert/src/image
parenta46c224de1a250472b476eac28f1854a689d8b11 (diff)
Utilisation plus judicieuse des operator new, etc...
Diffstat (limited to '2005/i/robert/src/image')
-rw-r--r--2005/i/robert/src/image/image.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/2005/i/robert/src/image/image.cc b/2005/i/robert/src/image/image.cc
index 99968c9..cee6690 100644
--- a/2005/i/robert/src/image/image.cc
+++ b/2005/i/robert/src/image/image.cc
@@ -95,7 +95,7 @@ Image::Rep::create (int width, int height, Image::PixelFormat pixelFormat)
{
unsigned bpp = Image::getBytePerPixel (pixelFormat);
unsigned bufSize = Image::getBufSize (width, height, pixelFormat);
- void *p = new uint8_t[bufSize * sizeof (uint8_t) + sizeof (Rep)];
+ void *p = operator new[] (bufSize * sizeof (uint8_t) + sizeof (Rep));
Rep *rep = new (p) Rep;
rep->width_ = width;
rep->height_ = height;
@@ -141,6 +141,7 @@ Image::Rep::release (void)
void
Image::Rep::destroy (void)
{
- delete[] reinterpret_cast<uint8_t *> (this);
+ this->~Rep ();
+ operator delete[] (this);
}