diff --git a/src/kits/package/JobQueue.cpp b/src/kits/package/JobQueue.cpp index 182856a602..bd5bceb708 100644 --- a/src/kits/package/JobQueue.cpp +++ b/src/kits/package/JobQueue.cpp @@ -159,8 +159,9 @@ JobQueue::Pop() if (head == fQueuedJobs->end()) return NULL; } + BJob* job = *head; fQueuedJobs->erase(head); - return *head; + return job; } return NULL;