mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 07:23:51 +02:00
Clean shutdown for Texture Transfer thread
This commit is contained in:
parent
b758acb7d8
commit
1b7256d344
2 changed files with 12 additions and 0 deletions
|
@ -44,6 +44,17 @@ GLTextureTransferHelper::GLTextureTransferHelper() {
|
||||||
_canvas->doneCurrent();
|
_canvas->doneCurrent();
|
||||||
initialize(true, QThread::LowPriority);
|
initialize(true, QThread::LowPriority);
|
||||||
_canvas->moveToThreadWithContext(_thread);
|
_canvas->moveToThreadWithContext(_thread);
|
||||||
|
|
||||||
|
// Clean shutdown on UNIX, otherwise _canvas is freed early
|
||||||
|
connect(qApp, &QCoreApplication::aboutToQuit, [&] { terminate(); });
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
GLTextureTransferHelper::~GLTextureTransferHelper() {
|
||||||
|
#ifdef THREADED_TEXTURE_TRANSFER
|
||||||
|
if (isStillRunning()) {
|
||||||
|
terminate();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ struct TextureTransferPackage {
|
||||||
class GLTextureTransferHelper : public GenericQueueThread<TextureTransferPackage> {
|
class GLTextureTransferHelper : public GenericQueueThread<TextureTransferPackage> {
|
||||||
public:
|
public:
|
||||||
GLTextureTransferHelper();
|
GLTextureTransferHelper();
|
||||||
|
~GLTextureTransferHelper();
|
||||||
void transferTexture(const gpu::TexturePointer& texturePointer);
|
void transferTexture(const gpu::TexturePointer& texturePointer);
|
||||||
void postTransfer(const gpu::TexturePointer& texturePointer);
|
void postTransfer(const gpu::TexturePointer& texturePointer);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue