CJob: Even cancel finished jobs

When a job was cancelled after its runThread() method finished, but before the
main thread noticed this and reacted, we would just run runMain() before and
pretend the job finished normally.

However, with CModuleJob this means that runMain() might get called for a module
which is currently being destructed. This has bad effects with virtual functions
and thus causes problems. It's better to just really cancel the job instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2014-08-07 22:19:15 +02:00
parent 5a6224d2b4
commit 74fdd97a52
2 changed files with 7 additions and 3 deletions

View File

@@ -154,7 +154,7 @@ public:
}
~CEmptyJob() {
EXPECT_FALSE(wasCancelled());
EXPECT_TRUE(wasCancelled());
m_bDestroyed = true;
}