viewer: set video and audio caches to children of the viewer
Ensures their thread gets changed along with the viewer. The project gets loaded/created in a background thread so the GUI can remain responsive, and is then moved to the main thread for intended event handling. However if the caches aren't parented, the hierarchy breaks and the caches remain in a thread whose event loop is quickly destroyed. Now that they're parented, events can be properly queued on them once again.
This commit is contained in:
@@ -32,7 +32,10 @@ class PlaybackCache : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PlaybackCache() = default;
|
||||
PlaybackCache(QObject* parent = nullptr) :
|
||||
QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void Invalidate(const TimeRange& r);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user