mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +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();
|
||||
initialize(true, QThread::LowPriority);
|
||||
_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
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ struct TextureTransferPackage {
|
|||
class GLTextureTransferHelper : public GenericQueueThread<TextureTransferPackage> {
|
||||
public:
|
||||
GLTextureTransferHelper();
|
||||
~GLTextureTransferHelper();
|
||||
void transferTexture(const gpu::TexturePointer& texturePointer);
|
||||
void postTransfer(const gpu::TexturePointer& texturePointer);
|
||||
|
||||
|
|
Loading…
Reference in a new issue