From 3272384ec0b32bc80d209d31f90a7d6f9e9060b7 Mon Sep 17 00:00:00 2001 From: AOYAMA Kazuharu Date: Sun, 1 Dec 2019 12:50:35 +0900 Subject: [PATCH] Fix a bug that timer for TSqlDatabasePool stops. #279 --- src/thttprequest.cpp | 2 +- src/tmultiplexingserver_linux.cpp | 4 ++++ src/tthreadapplicationserver_linux.cpp | 6 ++++++ src/twebapplication.cpp | 6 +++--- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/thttprequest.cpp b/src/thttprequest.cpp index 73048b235..9bad72b58 100644 --- a/src/thttprequest.cpp +++ b/src/thttprequest.cpp @@ -499,7 +499,7 @@ void THttpRequest::parseBody(const QByteArray &body, const THttpRequestHeader &h } else { tSystemWarn("unsupported content-type: %s", qPrintable(ctype)); } - /* FALLTHRU */ } + } /* FALLTHRU */ case Tf::Get: { // query parameter diff --git a/src/tmultiplexingserver_linux.cpp b/src/tmultiplexingserver_linux.cpp index 298b2763e..aca33caf0 100644 --- a/src/tmultiplexingserver_linux.cpp +++ b/src/tmultiplexingserver_linux.cpp @@ -118,6 +118,10 @@ bool TMultiplexingServer::start(bool debugMode) } } + // To work a timer in main thread + TSqlDatabasePool::instance(); + TKvsDatabasePool::instance(); + TStaticInitializeThread::exec(); QThread::start(); return true; diff --git a/src/tthreadapplicationserver_linux.cpp b/src/tthreadapplicationserver_linux.cpp index b445d91b3..afee9c154 100644 --- a/src/tthreadapplicationserver_linux.cpp +++ b/src/tthreadapplicationserver_linux.cpp @@ -9,6 +9,8 @@ #include #include #include +#include "tsqldatabasepool.h" +#include "tkvsdatabasepool.h" #include "tsystemglobal.h" #include "tfcore_unix.h" #include @@ -61,6 +63,10 @@ bool TThreadApplicationServer::start(bool debugMode) return false; } + // To work a timer in main thread + TSqlDatabasePool::instance(); + TKvsDatabasePool::instance(); + TStaticInitializeThread::exec(); QThread::start(); return true; diff --git a/src/twebapplication.cpp b/src/twebapplication.cpp index 0cb1a2764..9a53a89c2 100644 --- a/src/twebapplication.cpp +++ b/src/twebapplication.cpp @@ -38,11 +38,11 @@ namespace { /*! Constructor. */ -TWebApplication::TWebApplication(int &argc, char **argv) +TWebApplication::TWebApplication(int &argc, char **argv) : #ifdef TF_USE_GUI_MODULE - : QApplication(argc, argv), + QApplication(argc, argv), #else - : QCoreApplication(argc, argv), + QCoreApplication(argc, argv), #endif _dbEnvironment(DEFAULT_DATABASE_ENVIRONMENT) {