git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix endless loop when more than one CI can handle a service
[enigma2.git]
/
lib
/
gdi
/
gpixmap.cpp
diff --git
a/lib/gdi/gpixmap.cpp
b/lib/gdi/gpixmap.cpp
index c3d2cc31b977ef844987e2595a02008b3ae3d724..d0eff03f00f40d7f5a937f5e2a3bd9b6471346dc 100644
(file)
--- a/
lib/gdi/gpixmap.cpp
+++ b/
lib/gdi/gpixmap.cpp
@@
-106,7
+106,7
@@
gSurface::gSurface(eSize size, int _bpp, int accel)
clut.data = 0;
if (!data)
clut.data = 0;
if (!data)
- data =
malloc(y * stride)
;
+ data =
new unsigned char [y * stride]
;
type = 1;
}
type = 1;
}
@@
-118,9
+118,9
@@
gSurface::~gSurface()
if (data_phys)
gAccel::getInstance()->accelFree(data_phys);
else
if (data_phys)
gAccel::getInstance()->accelFree(data_phys);
else
-
free(data)
;
+
delete [] (unsigned char*)data
;
- delete[] clut.data;
+ delete
[] clut.data;
}
}
}
}
@@
-361,7
+361,7
@@
void gPixmap::blit(const gPixmap &src, ePoint pos, const gRegion &clip, int flag
dstptr+=surface->stride;
}
} else
dstptr+=surface->stride;
}
} else
- e
Fatal
("cannot blit %dbpp from %dbpp", surface->bpp, src.surface->bpp);
+ e
Warning
("cannot blit %dbpp from %dbpp", surface->bpp, src.surface->bpp);
}
}
}
}
@@
-538,13
+538,17
@@
DEFINE_REF(gPixmap);
gPixmap::~gPixmap()
{
gPixmap::~gPixmap()
{
+ if (must_delete_surface)
+ delete surface;
}
}
-gPixmap::gPixmap(gSurface *surface): surface(surface)
+gPixmap::gPixmap(gSurface *surface)
+ :surface(surface), must_delete_surface(false)
{
}
gPixmap::gPixmap(eSize size, int bpp, int accel)
{
}
gPixmap::gPixmap(eSize size, int bpp, int accel)
+ :must_delete_surface(true)
{
surface = new gSurface(size, bpp, accel);
}
{
surface = new gSurface(size, bpp, accel);
}