mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:41:20 +02:00
Merge pull request #1 from overte-org/fix/recording_deadlock
Fix recording deadlocks
This commit is contained in:
commit
e351a92310
2 changed files with 6 additions and 5 deletions
|
@ -64,8 +64,10 @@ float RecordingScriptingInterface::playerLength() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecordingScriptingInterface::playClip(NetworkClipLoaderPointer clipLoader, const QString& url, const ScriptValue& callback) {
|
void RecordingScriptingInterface::playClip(NetworkClipLoaderPointer clipLoader, const QString& url, const ScriptValue& callback) {
|
||||||
Locker lock(_mutex);
|
{
|
||||||
_player->queueClip(clipLoader->getClip());
|
Locker lock(_mutex);
|
||||||
|
_player->queueClip(clipLoader->getClip());
|
||||||
|
}
|
||||||
|
|
||||||
if (callback.isFunction()) {
|
if (callback.isFunction()) {
|
||||||
auto engine = callback.engine();
|
auto engine = callback.engine();
|
||||||
|
@ -75,8 +77,6 @@ void RecordingScriptingInterface::playClip(NetworkClipLoaderPointer clipLoader,
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecordingScriptingInterface::loadRecording(const QString& url, const ScriptValue& callback) {
|
void RecordingScriptingInterface::loadRecording(const QString& url, const ScriptValue& callback) {
|
||||||
Locker lock(_mutex);
|
|
||||||
|
|
||||||
auto clipLoader = DependencyManager::get<recording::ClipCache>()->getClipLoader(url);
|
auto clipLoader = DependencyManager::get<recording::ClipCache>()->getClipLoader(url);
|
||||||
|
|
||||||
if (clipLoader->isLoaded()) {
|
if (clipLoader->isLoaded()) {
|
||||||
|
@ -85,6 +85,8 @@ void RecordingScriptingInterface::loadRecording(const QString& url, const Script
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Locker lock(_mutex);
|
||||||
|
|
||||||
// hold a strong pointer to the loading clip so that it has a chance to load
|
// hold a strong pointer to the loading clip so that it has a chance to load
|
||||||
_clipLoaders.insert(clipLoader);
|
_clipLoaders.insert(clipLoader);
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,6 @@ Promise AssetScriptingInterface::jsPromiseReady(Promise promise, const ScriptVal
|
||||||
void AssetScriptingInterface::jsCallback(const ScriptValue& handler,
|
void AssetScriptingInterface::jsCallback(const ScriptValue& handler,
|
||||||
const ScriptValue& error, const ScriptValue& result) {
|
const ScriptValue& error, const ScriptValue& result) {
|
||||||
Q_ASSERT(thread() == QThread::currentThread());
|
Q_ASSERT(thread() == QThread::currentThread());
|
||||||
Q_ASSERT(engine());
|
|
||||||
//V8TODO: which kind of script context guard needs to be used here?
|
//V8TODO: which kind of script context guard needs to be used here?
|
||||||
ScriptContextGuard scriptContextGuard(_scriptManager->engine()->currentContext());
|
ScriptContextGuard scriptContextGuard(_scriptManager->engine()->currentContext());
|
||||||
auto errorValue = !error.toBool() ? engine()->nullValue() : error;
|
auto errorValue = !error.toBool() ? engine()->nullValue() : error;
|
||||||
|
|
Loading…
Reference in a new issue