diff options
| author | Machiavelli <none@none> | 2010-08-23 18:15:01 +0200 |
|---|---|---|
| committer | Machiavelli <none@none> | 2010-08-23 18:15:01 +0200 |
| commit | 2a57bc9cdc125d8997f60e04de8410a5ef82525c (patch) | |
| tree | 335b19fc5a47bedc61e0834d7b8b447c31208e37 /src/server/worldserver/CommandLine | |
| parent | 050f85b2c60a455b9326bd2c1461d3537fa0bae5 (diff) | |
- Fix potential singleton memory deallocation problems
- Fix ¨mysql_global_end() 1 thread didn´t exit¨ error
Author: Derex
--HG--
branch : trunk
Diffstat (limited to 'src/server/worldserver/CommandLine')
| -rw-r--r-- | src/server/worldserver/CommandLine/CliRunnable.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index 01f2a2985c1..ef114e87467 100644 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -83,6 +83,14 @@ char ** cli_completion(const char * text, int start, int /*end*/) rl_bind_key('\t',rl_abort); return (matches); } + +int cli_hook_func(void) +{ + if (World::IsStopped()) + rl_done = 1; + return 0; +} + #endif void utf8print(void* /*arg*/, const char* str) @@ -717,6 +725,7 @@ void CliRunnable::run() //sLog.outString(""); #if PLATFORM != WINDOWS rl_attempted_completion_function = cli_completion; + rl_event_hook = cli_hook_func; #endif if (sConfig.GetBoolDefault("BeepAtStart", true)) printf("\a"); // \a = Alert |
