diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-04-14 16:04:57 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-04-16 11:48:33 -0700 |
commit | f7e6cb9d26dded3f33e8da18a7b16a7e64cefd5b (patch) | |
tree | 9f30f0e4ffadc3fefa20048624a50c58bce562e4 /src/map/clif.cpp | |
parent | 66b050356abc494fd57c3b4e42d4abc61c832e8c (diff) | |
download | tmwa-f7e6cb9d26dded3f33e8da18a7b16a7e64cefd5b.tar.gz tmwa-f7e6cb9d26dded3f33e8da18a7b16a7e64cefd5b.tar.bz2 tmwa-f7e6cb9d26dded3f33e8da18a7b16a7e64cefd5b.tar.xz tmwa-f7e6cb9d26dded3f33e8da18a7b16a7e64cefd5b.zip |
Fix memory violation in delayed close
Diffstat (limited to 'src/map/clif.cpp')
-rw-r--r-- | src/map/clif.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/map/clif.cpp b/src/map/clif.cpp index a7dcb52..ea92d15 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -1098,8 +1098,6 @@ void clif_quitsave(Session *, dumb_ptr<map_session_data> sd) static void clif_waitclose(TimerData *, tick_t, Session *s) { - // TODO: what happens if the player disconnects - // and someone else connects? if (s) s->eof = 1; } @@ -1110,10 +1108,10 @@ void clif_waitclose(TimerData *, tick_t, Session *s) */ void clif_setwaitclose(Session *s) { - Timer(gettick() + std::chrono::seconds(5), + s->timed_close = Timer(gettick() + std::chrono::seconds(5), std::bind(clif_waitclose, ph::_1, ph::_2, s) - ).detach(); + ); } /*========================================== |