Fixed issue #518 (Occasional crash using batch queue)
This commit is contained in:
parent
d7075d2928
commit
301c8fa2b6
@ -69,12 +69,20 @@ void BatchQueueEntryUpdater::process_ () {
|
|||||||
tostop = false;
|
tostop = false;
|
||||||
|
|
||||||
// TODO: process visible jobs first
|
// TODO: process visible jobs first
|
||||||
while (!tostop && !jqueue.empty ()) {
|
bool isEmpty=false;
|
||||||
|
|
||||||
|
while (!tostop && !isEmpty) {
|
||||||
|
|
||||||
qMutex->lock ();
|
qMutex->lock ();
|
||||||
Job current = jqueue.front ();
|
isEmpty=jqueue.empty (); // do NOT put into while() since it must be within mutex section
|
||||||
|
Job current;
|
||||||
|
if (!isEmpty) {
|
||||||
|
current = jqueue.front ();
|
||||||
jqueue.pop_front ();
|
jqueue.pop_front ();
|
||||||
|
}
|
||||||
qMutex->unlock ();
|
qMutex->unlock ();
|
||||||
if (current.listener) {
|
|
||||||
|
if (!isEmpty && current.listener) {
|
||||||
int neww = current.newh * current.ow / current.oh;
|
int neww = current.newh * current.ow / current.oh;
|
||||||
guint8* img = new guint8 [current.newh*neww*3];
|
guint8* img = new guint8 [current.newh*neww*3];
|
||||||
thumbInterp (current.oimg, current.ow, current.oh, img, neww, current.newh);
|
thumbInterp (current.oimg, current.ow, current.oh, img, neww, current.newh);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user