Batch queue/preview stability enhancements; see issue #611
This commit is contained in:
@@ -26,6 +26,7 @@ BatchQueueEntry::BatchQueueEntry (rtengine::ProcessingJob* pjob, const rtengine:
|
||||
|
||||
params = pparams;
|
||||
|
||||
// The BatchQueueEntryIdleHelper tracks if
|
||||
bqih = new BatchQueueEntryIdleHelper;
|
||||
bqih->bqentry = this;
|
||||
bqih->destroyed = false;
|
||||
@@ -98,19 +99,21 @@ void BatchQueueEntry::removeButtonSet () {
|
||||
delete buttonSet;
|
||||
buttonSet = NULL;
|
||||
}
|
||||
struct bqupdate {
|
||||
|
||||
struct BQUpdateParam {
|
||||
BatchQueueEntryIdleHelper* bqih;
|
||||
guint8* img;
|
||||
int w,h;
|
||||
};
|
||||
|
||||
int bqeupdate (void* data) {
|
||||
int updateImageUIThread (void* data) {
|
||||
|
||||
gdk_threads_enter ();
|
||||
bqupdate* params = (bqupdate*)data;
|
||||
BQUpdateParam* params = (BQUpdateParam*)data;
|
||||
|
||||
BatchQueueEntryIdleHelper* bqih = params->bqih;
|
||||
|
||||
// If the BQEntry was destroyed meanwhile, remove all the IdleHelper if all entries came through
|
||||
if (bqih->destroyed) {
|
||||
if (bqih->pending == 1)
|
||||
delete bqih;
|
||||
@@ -130,16 +133,17 @@ int bqeupdate (void* data) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Starts a copy of img->preview via GTK thread
|
||||
void BatchQueueEntry::updateImage (guint8* img, int w, int h) {
|
||||
|
||||
bqih->pending++;
|
||||
|
||||
bqupdate* param = new bqupdate ();
|
||||
BQUpdateParam* param = new BQUpdateParam ();
|
||||
param->bqih = bqih;
|
||||
param->img = img;
|
||||
param->w = w;
|
||||
param->h = h;
|
||||
g_idle_add (bqeupdate, param);
|
||||
g_idle_add (updateImageUIThread, param);
|
||||
}
|
||||
|
||||
void BatchQueueEntry::_updateImage (guint8* img, int w, int h) {
|
||||
|
Reference in New Issue
Block a user