mirror of
https://github.com/QuasarApp/Heart.git
synced 2025-04-28 10:44:39 +00:00
The errors location will be findet.
This commit is contained in:
parent
bcebc628c4
commit
cb7e96dc9c
@ -3,6 +3,7 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QDateTime>
|
||||
#include <QThread>
|
||||
#include <QDebug>
|
||||
|
||||
// Private implementation of waitFor functions.
|
||||
#define waitPrivate(CONDITION, TIMEOUT) \
|
||||
@ -26,6 +27,17 @@ void Async::asyncHandler(Job job,
|
||||
|
||||
bool result = job();
|
||||
|
||||
/*This IS ULTRA BUG
|
||||
* For reproduse:
|
||||
* 1. run gdb
|
||||
* 2. skip the 3 step of the asyncLauncher method.
|
||||
* 3. add breackpoint in to this function.
|
||||
* 4. operator = for the resultOfWork operand broken the stack of main thread.
|
||||
* This is true magick.
|
||||
* -\_O_/-
|
||||
* */
|
||||
qDebug() << resultOfWork << " : " << *resultOfWork;
|
||||
|
||||
if (resultOfWork)
|
||||
*resultOfWork = result;
|
||||
|
||||
|
@ -19,7 +19,9 @@ using namespace PKG;
|
||||
|
||||
AsyncSqlDbWriter::AsyncSqlDbWriter(QObject *ptr):
|
||||
SqlDBWriter(ptr) {
|
||||
_own = new QThread(this);
|
||||
|
||||
_own = new QThread();
|
||||
_own->setObjectName("AsyncSqlDbWriter");
|
||||
moveToThread(_own);
|
||||
_own->start();
|
||||
|
||||
@ -28,5 +30,7 @@ AsyncSqlDbWriter::AsyncSqlDbWriter(QObject *ptr):
|
||||
AsyncSqlDbWriter::~AsyncSqlDbWriter() {
|
||||
_own->quit();
|
||||
_own->wait();
|
||||
|
||||
_own->deleteLater();
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ namespace QH {
|
||||
* @brief The AsyncSqlDbWriter class is some as SqlDBWriter bud run all commnad in own thread
|
||||
* This class is thread save.
|
||||
*/
|
||||
class AsyncSqlDbWriter : public SqlDBWriter
|
||||
class AsyncSqlDbWriter final : public SqlDBWriter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include <QSqlRecord>
|
||||
#include <QStandardPaths>
|
||||
#include <QCoreApplication>
|
||||
#include <QThread>
|
||||
|
||||
namespace QH {
|
||||
using namespace PKG;
|
||||
|
Loading…
x
Reference in New Issue
Block a user