View Full Version : wrong usage of delete in outline_provider_bitmap_generic.cpp
stick
11-10-2008, 02:33 PM
ClanLib-0.8 checkout:
Index: outline_provider_bitmap_generic.cpp
================================================== =================
--- outline_provider_bitmap_generic.cpp (revision 1982)
+++ outline_provider_bitmap_generic.cpp (working copy)
@@ -105,7 +105,7 @@
CL_OutlineProviderBitmap_Generic::~CL_OutlineProvi derBitmap_Generic()
{
- delete data;
+ delete[] data;
}
void CL_OutlineProviderBitmap_Generic::find_contours()
gpmfuchs
11-10-2008, 09:03 PM
I did an code audit in Sources\Display\Providers and found another one of this kind:
Index: Sources/Display/Providers/png_provider.cpp
================================================== =================
--- Sources/Display/Providers/png_provider.cpp (revision 1982)
+++ Sources/Display/Providers/png_provider.cpp (working copy)
@@ -110,8 +110,8 @@
png_destroy_write_struct( &png_ptr, &info_ptr );
- delete image;
- delete row_pointers;
+ delete image[];
+ delete row_pointers[];
fclose(fp);
update I completed the code audit of Sources\Display there are no other errors of this type
Index: Sources/Core/IOData/Generic/datafile_inputprovider.cpp
================================================== =================
--- Sources/Core/IOData/Generic/datafile_inputprovider.cpp (revision 1982)
+++ Sources/Core/IOData/Generic/datafile_inputprovider.cpp (working copy)
@@ -259,7 +259,7 @@
{
char *temp = new char[pos];
read(temp, pos);
- delete temp;
+ delete temp[];
}
else if (pos < 0)
{
I completed the code audit of Sources/Core there are no more bugs of this kind
Index: Sources/GL/graphic_context_opengl.cpp
================================================== =================
--- Sources/GL/graphic_context_opengl.cpp (revision 1982)
+++ Sources/GL/graphic_context_opengl.cpp (working copy)
@@ -132,7 +132,7 @@
memcpy(buf + ((height-y-1) * pitch), buf + (y * pitch), sizeof(unsigned char) * pitch);
memcpy(buf + (y * pitch), tmp, sizeof(unsigned char) * pitch);
}
- delete tmp;
+ delete tmp[];
buffer.unlock();
clReadBuffer(old_frame);
I completed the code audit of Sources/GL there seem to be no more bugs of this kind
Sources/Vorbis is clear
Sources/Sound seems clear
Sources/Signal is clear
Sources/SDL seems clear
Sources/Network seems clear
Sources/MikMod clear
Sources/GUI clear
Sources/GUIStyleSilver clear
=> Sources clear
rombust
11-13-2008, 02:28 PM
Also confirmed and fixed in 0.9
Also fixed on 0.8
Many thanks
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.