Prevent Interface from crashing when a Snapshot upload fails

This commit is contained in:
Zach Fox 2018-04-05 11:27:26 -07:00
parent 2e37b4a312
commit 8e46ebf83b
2 changed files with 4 additions and 6 deletions

View file

@ -65,7 +65,7 @@ void SnapshotUploader::uploadSuccess(QNetworkReply& reply) {
} else {
emit DependencyManager::get<WindowScriptingInterface>()->snapshotShared(true, contents);
delete this;
this->deleteLater();
}
}
@ -76,13 +76,13 @@ void SnapshotUploader::uploadFailure(QNetworkReply& reply) {
replyString = reply.errorString();
}
emit DependencyManager::get<WindowScriptingInterface>()->snapshotShared(true, replyString); // maybe someday include _inWorldLocation, _filename?
delete this;
this->deleteLater();
}
void SnapshotUploader::createStorySuccess(QNetworkReply& reply) {
QString replyString = reply.readAll();
emit DependencyManager::get<WindowScriptingInterface>()->snapshotShared(false, replyString);
delete this;
this->deleteLater();
}
void SnapshotUploader::createStoryFailure(QNetworkReply& reply) {
@ -92,6 +92,6 @@ void SnapshotUploader::createStoryFailure(QNetworkReply& reply) {
replyString = reply.errorString();
}
emit DependencyManager::get<WindowScriptingInterface>()->snapshotShared(true, replyString);
delete this;
this->deleteLater();
}

View file

@ -411,8 +411,6 @@ function snapshotUploaded(isError, reply) {
} else {
print('Ignoring snapshotUploaded() callback for stale ' + (isGif ? 'GIF' : 'Still' ) + ' snapshot. Stale story ID:', storyID);
}
} else {
print(reply);
}
isUploadingPrintableStill = false;
}