aboutsummaryrefslogtreecommitdiff
path: root/engines/neverhood
diff options
context:
space:
mode:
Diffstat (limited to 'engines/neverhood')
-rw-r--r--engines/neverhood/gamemodule.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index 49682b0d29..db4d0ef374 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -440,6 +440,10 @@ void GameModule::checkRequests() {
void GameModule::createModule(int moduleNum, int which) {
debug("GameModule::createModule(%d, %d)", moduleNum, which);
_moduleNum = moduleNum;
+
+ if (_childObject)
+ delete _childObject;
+
switch (_moduleNum) {
case 1000:
setGlobalVar(V_MODULE_NAME, 0x03294419);