mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-23 05:15:34 +00:00
Fix stack balancing problems by refactoring execution calls
- Con::executef now uses a template - All public execution functions now restore the console stack upon return - Fixed bad parameters on some callbacks - Reverts get*Arg behavior
This commit is contained in:
parent
b1ad72692c
commit
f44a3f27d6
43 changed files with 1781 additions and 358 deletions
|
|
@ -114,19 +114,22 @@ public:
|
|||
|
||||
~SimConsoleEvent();
|
||||
virtual void process(SimObject *object);
|
||||
|
||||
/// Creates a reference to our internal args list in argv
|
||||
void populateArgs(ConsoleValueRef *argv);
|
||||
};
|
||||
|
||||
/// Used by Con::threadSafeExecute()
|
||||
struct SimConsoleThreadExecCallback
|
||||
{
|
||||
Semaphore *sem;
|
||||
const char *retVal;
|
||||
ConsoleValueRef retVal;
|
||||
|
||||
SimConsoleThreadExecCallback();
|
||||
~SimConsoleThreadExecCallback();
|
||||
|
||||
void handleCallback(const char *ret);
|
||||
const char *waitForResult();
|
||||
void handleCallback(ConsoleValueRef ret);
|
||||
ConsoleValueRef waitForResult();
|
||||
};
|
||||
|
||||
class SimConsoleThreadExecEvent : public SimConsoleEvent
|
||||
|
|
@ -136,6 +139,7 @@ class SimConsoleThreadExecEvent : public SimConsoleEvent
|
|||
public:
|
||||
SimConsoleThreadExecEvent(S32 argc, ConsoleValueRef *argv, bool onObject, SimConsoleThreadExecCallback *callback);
|
||||
|
||||
SimConsoleThreadExecCallback& getCB() { return *cb; }
|
||||
virtual void process(SimObject *object);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue