Dealloc CoreGraphics Shmem for OOPP. b=560941 r=josh

This commit is contained in:
Benoit Girard 2010-05-20 15:22:41 -04:00
Родитель ec4271b927
Коммит e95d127d48
1 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -115,6 +115,9 @@ PluginInstanceParent::~PluginInstanceParent()
"Subclass was not reset correctly before the dtor was reached!");
#endif
#if defined(OS_MACOSX)
if (mShWidth != 0 && mShHeight != 0) {
DeallocShmem(mShSurface);
}
if (mShColorSpace)
::CGColorSpaceRelease(mShColorSpace);
if (mIOSurface)
@ -508,10 +511,12 @@ PluginInstanceParent::NPP_SetWindow(const NPWindow* aWindow)
}
mIOSurface = nsIOSurface::CreateIOSurface(window.width, window.height);
} else if (mShWidth * mShHeight != window.width * window.height) {
// Uncomment me when DeallocShmem lands.
//if (mShWidth != 0 && mShHeight != 0) {
// DeallocShmem(&mShSurface);
//}
if (mShWidth != 0 && mShHeight != 0) {
DeallocShmem(mShSurface);
mShWidth = 0;
mShHeight = 0;
}
if (window.width != 0 && window.height != 0) {
if (!AllocShmem(window.width * window.height*4,
SharedMemory::TYPE_BASIC, &mShSurface)) {