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