You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue was created in the GarageGames Repository (Link to original issue).
The issue was originally created by @jamesu and had a total of 2 comments that may contain additional information. The original issue description is pasted below:
After modifying the console variable system I noticed that console variables were being added more than once in Con::init. If for example you put a breakpoint in "EditTSCtrl::consoleInit()", you'll notice its called at least 12 times. For "ShapeBase::consoleInit()", 8 times.
The issue seems to be when you don't override consoleInit in a derived class the ConcreteClassRep helper ends up calling the nearest implementation in a base class. Since ::consoleInit() is only usually used to define global variables, the extra calls are essentially redundant.
e.g.
// Calls MyConsoleObject::consoleInit during console init, great!
class MyConsoleObject : SimObject {
static void consoleInit();
};
// Calls MyConsoleObject::consoleInit() during console init, ...
class MyDerivedConsoleObject : MyConsoleObject {
};
// Still calls MyConsoleObject::consoleInit() during console init, ...
class MyOtherConsoleObject : MyDerivedConsoleObject {
};
Possible solutions:
Create an empty consoleInit function in the next derived class.
Use a more flat class hierarchy.
Expose consoleInit in some other way which prevents this duplication.
The text was updated successfully, but these errors were encountered:
This issue was created in the GarageGames Repository (Link to original issue).
The issue was originally created by @jamesu and had a total of 2 comments that may contain additional information. The original issue description is pasted below:
After modifying the console variable system I noticed that console variables were being added more than once in Con::init. If for example you put a breakpoint in "EditTSCtrl::consoleInit()", you'll notice its called at least 12 times. For "ShapeBase::consoleInit()", 8 times.
The issue seems to be when you don't override consoleInit in a derived class the ConcreteClassRep helper ends up calling the nearest implementation in a base class. Since ::consoleInit() is only usually used to define global variables, the extra calls are essentially redundant.
e.g.
Possible solutions:
Create an empty consoleInit function in the next derived class.
Use a more flat class hierarchy.
Expose consoleInit in some other way which prevents this duplication.
The text was updated successfully, but these errors were encountered: