Handle refactor

This commit is contained in:
elasota
2019-12-29 23:14:37 -05:00
parent 9cf539eb52
commit fb105bd338
37 changed files with 365 additions and 240 deletions

View File

@@ -839,16 +839,16 @@ Boolean PictIDExists (short theID)
thePicture = GetPicture(theID);
if (thePicture == nil)
{
thePicture = (PicHandle)GetResource('Date', theID);
thePicture = GetResource('Date', theID).StaticCast<Picture>();
if (thePicture == nil)
{
foundIt = false;
}
else
DisposeHandle((Handle)thePicture);
thePicture.Dispose();
}
else
DisposeHandle((Handle)thePicture);
thePicture.Dispose();
// foundIt = false;
// numPicts = Count1Resources('PICT');
@@ -880,8 +880,8 @@ short GetFirstPICT (void)
resHandle = Get1IndResource('PICT', 1);
if (resHandle != nil)
{
const PortabilityLayer::ResourceCompiledRef *resRef = PortabilityLayer::ResourceManager::GetInstance()->ResourceForHandle(reinterpret_cast<PortabilityLayer::MMHandleBlock*>(resHandle));
DisposeHandle(resHandle);
const PortabilityLayer::ResourceCompiledRef *resRef = PortabilityLayer::ResourceManager::GetInstance()->ResourceForHandle(resHandle.MMBlock());
resHandle.Dispose();
return resRef->m_resID;
}
else