mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-02 17:03:13 +00:00
GRIM: Don't try to delete the same bitmap twice.
This commit is contained in:
parent
5d0a6ea56b
commit
1427f47dd1
@ -1217,6 +1217,9 @@ void GrimEngine::restoreObjects(Common::HashMap<int32, T *> &map, uint32 ID) {
|
||||
t->restoreState(_savedState);
|
||||
}
|
||||
for (typename Common::HashMap<int32, T *>::iterator i = map.begin(); i != map.end(); ++i) {
|
||||
// Make sure to not try to delete objects which were deleted already by
|
||||
// functions like restoreBitmaps().
|
||||
i->_value->reset();
|
||||
delete i->_value;
|
||||
}
|
||||
map = tempMap;
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
Object();
|
||||
virtual ~Object();
|
||||
|
||||
void reset() { };
|
||||
void reference();
|
||||
void dereference();
|
||||
|
||||
|
@ -78,6 +78,13 @@ Scene::~Scene() {
|
||||
}
|
||||
}
|
||||
|
||||
void Scene::reset() {
|
||||
for (int i = 0; i < _numSetups; ++i) {
|
||||
_setups[i]._bkgndBm = NULL;
|
||||
_setups[i]._bkgndZBm = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int32 Scene::getId() {
|
||||
return _id;
|
||||
}
|
||||
|
@ -120,6 +120,7 @@ public:
|
||||
};
|
||||
|
||||
Setup *getCurrSetup() { return _currSetup; }
|
||||
void reset();
|
||||
|
||||
private:
|
||||
bool _locked;
|
||||
|
Loading…
x
Reference in New Issue
Block a user