diff options
author | saturneric <[email protected]> | 2024-12-02 22:53:51 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-12-02 22:53:51 +0000 |
commit | 78a5ece0391cb0e8cecde95f43afe4479a6709ab (patch) | |
tree | 9114b46fb28d58ef63546a78994cc23b6caa909a /src/core/thread/Task.cpp | |
parent | fix: solve memory issues of sdk apis (diff) | |
download | GpgFrontend-78a5ece0391cb0e8cecde95f43afe4479a6709ab.tar.gz GpgFrontend-78a5ece0391cb0e8cecde95f43afe4479a6709ab.zip |
fix: discovered issues
Diffstat (limited to 'src/core/thread/Task.cpp')
-rw-r--r-- | src/core/thread/Task.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/thread/Task.cpp b/src/core/thread/Task.cpp index 71c3f7b2..d96d3c8c 100644 --- a/src/core/thread/Task.cpp +++ b/src/core/thread/Task.cpp @@ -120,7 +120,7 @@ class Task::Impl { const QString name_; TaskRunnable runnable_; ///< TaskCallback callback_; ///< - int rtn_ = -99; ///< + int rtn_ = Task::kInitialRTN; ///< QThread *callback_thread_ = nullptr; ///< DataObjectPtr data_object_ = nullptr; ///< @@ -139,6 +139,7 @@ class Task::Impl { [this](int rtn) { // set task returning code SetRTN(rtn); + try { if (callback_) { callback_(rtn_, data_object_); @@ -147,6 +148,9 @@ class Task::Impl { LOG_W() << "task: {}, " << GetFullID() << "callback caught exception, rtn: " << rtn; } + + LOG_D() << "task" << this->name_ + << "sending task end signal, rtn:" << rtn; emit parent_->SignalTaskEnd(); }); @@ -224,5 +228,6 @@ void Task::slot_exception_safe_run() noexcept { // raise signal to anounce after runnable returned if (this->autoDelete()) emit this->SignalTaskShouldEnd(rtn); } -auto Task::GetRTN() { return p_->GetRTN(); } + +auto Task::GetRTN() -> int { return p_->GetRTN(); } } // namespace GpgFrontend::Thread
\ No newline at end of file |