From a4968427e2eeec59f60c6f72a82d15ddd521347c Mon Sep 17 00:00:00 2001 From: Dwight Date: Mon, 3 Nov 2008 20:42:59 -0500 Subject: bug fix with $natural timeout on connects w/dbgrid faster --- util/background.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'util/background.cpp') diff --git a/util/background.cpp b/util/background.cpp index 02f623b894e..e1dcb163754 100644 --- a/util/background.cpp +++ b/util/background.cpp @@ -24,12 +24,14 @@ boost::mutex BackgroundJob::mutex; /* static */ void BackgroundJob::thr() { assert( grab ); - assert( grab->state == NotStarted ); - grab->state = Running; - grab->run(); - grab->state = Done; - if( grab->deleteSelf ) - delete grab; + BackgroundJob *us = grab; + assert( us->state == NotStarted ); + us->state = Running; + grab = 0; + us->run(); + us->state = Done; + if( us->deleteSelf ) + delete us; } BackgroundJob& BackgroundJob::go() { -- cgit v1.2.1