Skip to content

Commit

Permalink
fix release bug
Browse files Browse the repository at this point in the history
  • Loading branch information
astrozhou committed Jun 2, 2017
1 parent 26d7614 commit e73d0c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mars/stn/src/net_core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ NetCore::~NetCore() {

void NetCore::__Release(NetCore* _instance) {

if (MessageQueue::CurrentThreadMessageQueue() != MessageQueue::Handler2Queue(_instance->asyncreg_.Get())) {
WaitMessage(AsyncInvoke((MessageQueue::AsyncInvokeFunction)boost::bind(&NetCore::__Release, _instance), _instance->asyncreg_.Get()));
if (MessageQueue::CurrentThreadMessageQueue() == MessageQueue::Handler2Queue(_instance->asyncreg_.Get())) {
AsyncInvoke((MessageQueue::AsyncInvokeFunction)boost::bind(&NetCore::__Release, _instance), MessageQueue::DefAsyncInvokeHandler(MessageQueue::GetDefMessageQueue()));
return;
}

Expand Down
2 changes: 1 addition & 1 deletion mars/stn/src/net_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ enum {

class NetCore {
public:
SINGLETON_INTRUSIVE(NetCore, new NetCore, delete);
SINGLETON_INTRUSIVE(NetCore, new NetCore, __Release);

public:
boost::function<void (Task& _task)> task_process_hook_;
Expand Down

0 comments on commit e73d0c8

Please sign in to comment.