mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-31 08:37:26 +00:00
Properly handle Task Deletion #703
This commit is contained in:
parent
54ea5f014e
commit
a3188ed028
@ -1,20 +1,20 @@
|
||||
|
||||
#include "R2Task.h"
|
||||
|
||||
R2Task::R2Task(const QString &cmd)
|
||||
R2Task::R2Task(const QString &cmd, bool transient)
|
||||
{
|
||||
task = r_core_task_new(Core()->core(),
|
||||
true,
|
||||
cmd.toLocal8Bit().constData(),
|
||||
static_cast<RCoreTaskCallback>(&R2Task::taskFinishedCallback),
|
||||
this);
|
||||
task->transient = transient;
|
||||
r_core_task_incref(task);
|
||||
}
|
||||
|
||||
R2Task::~R2Task()
|
||||
{
|
||||
// Don't delete current task as it might be still running
|
||||
// TODO
|
||||
// For now tasks are not freed, so find we need to something
|
||||
r_core_task_decref(task);
|
||||
}
|
||||
|
||||
void R2Task::taskFinishedCallback(void *user, char *)
|
||||
|
@ -15,7 +15,7 @@ private:
|
||||
void taskFinished();
|
||||
|
||||
public:
|
||||
explicit R2Task(const QString &cmd);
|
||||
explicit R2Task(const QString &cmd, bool transient = true);
|
||||
~R2Task();
|
||||
|
||||
void startTask();
|
||||
|
Loading…
Reference in New Issue
Block a user