Skip to content

Commit

Permalink
fix deconstruct error
Browse files Browse the repository at this point in the history
  • Loading branch information
CatKang committed Oct 17, 2017
1 parent 0714609 commit 9ef57af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
1 change: 0 additions & 1 deletion include/pika_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ class PikaServer {
}

void DoTimingTask();
void Cleanup();

PikaSlavepingThread* ping_thread_;

Expand Down
9 changes: 9 additions & 0 deletions src/pika.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@ int main(int argc, char *argv[]) {
}

g_pika_server->Start();

if (g_pika_conf->daemonize()) {
unlink(g_pika_conf->pidfile().c_str());
}

delete g_pika_server;
DestoryCmdInfoTable();
::google::ShutdownGoogleLogging();
delete g_pika_conf;

return 0;
}
18 changes: 0 additions & 18 deletions src/pika_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ PikaServer::~PikaServer() {
StopKeyScan();
key_scan_thread_.StopThread();

DestoryCmdInfoTable();
delete logger_;
db_.reset();
pthread_rwlock_destroy(&state_protector_);
Expand Down Expand Up @@ -228,22 +227,6 @@ bool PikaServer::ServerInit() {

}

void PikaServer::Cleanup() {
// shutdown server
if (g_pika_conf->daemonize()) {
unlink(g_pika_conf->pidfile().c_str());
}

// DestoryCmdInfoTable();

//g_pika_server->shutdown = true;
//sleep(1);

delete this;
delete g_pika_conf;
::google::ShutdownGoogleLogging();
}

void PikaServer::Start() {
int ret = 0;
ret = pika_dispatch_thread_->StartThread();
Expand Down Expand Up @@ -296,7 +279,6 @@ void PikaServer::Start() {
}
}
LOG(INFO) << "Goodbye...";
Cleanup();
}

void PikaServer::DeleteSlave(const std::string& ip, int64_t port) {
Expand Down

0 comments on commit 9ef57af

Please sign in to comment.