Fixed epic bug in runtime.cpp causing non-Lua-owned objects to be released by Lua GC.

This commit is contained in:
rude
2009-09-05 16:14:52 +02:00
parent fea48f421c
commit 3c2bd1bd9c
12 changed files with 1038 additions and 10 deletions
+2 -1
View File
@@ -171,6 +171,7 @@ namespace devil
ILuint h = d->getHeight();
int headerLen, bpp;
switch (f) {
case Image::FORMAT_TGA: // MSVC issues warning when there's no case statement.
default: // since we only support one format
headerLen = 18;
bpp = 3;
@@ -202,7 +203,7 @@ namespace devil
ILubyte * temp = new ILubyte[row];
ILubyte * src = data - row;
ILubyte * dst = data + size;
for (int i = 0; i < (h >> 1); i++) {
for (unsigned i = 0; i < (h >> 1); i++) {
memcpy(temp,src+=row,row);
memcpy(src,dst-=row,row);
memcpy(dst,temp,row);