Page MenuHome

The python objects in the `bge.logic.globalDict` are not destructed at the end of the game
Closed, ResolvedPublic

Description

System Information
Windows

Blender Version
Broken: 2.76

Short description of error
The python objects in the bge.logic.globalDict are not destructed at the end of the game.

This sample file is supposed to print the constructor and destructor message for both cases (bge.logic.destructor_bug, and bge.logic.globalDict['destructor_bug']), but the destructor message only happens for the case bge.logic.destructor_bug:

The .blend simply calls the following code:

from bge import logic

def init():
    logic.destructor_bug = Destructor("logic.destructor_bug")
    logic.globalDict['destructor_bug'] = Destructor("logic.globalDict['destructor_bug']")


class Destructor:
    def __init__(self, message):
        self._message = message        
        print("constructor:", self._message)


    def __del__(self):
        print("destructor:", self._message)


init()