[Scummvm-git-logs] scummvm master -> e9e89f0a70d527f26150e20a72dc3f03513ba48e

lephilousophe noreply at scummvm.org
Sat Dec 9 22:59:30 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e9e89f0a70 BACKENDS: NETWORKING: Don't handle request if it's not processing


Commit: e9e89f0a70d527f26150e20a72dc3f03513ba48e
    https://github.com/scummvm/scummvm/commit/e9e89f0a70d527f26150e20a72dc3f03513ba48e
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-12-09T23:59:06+01:00

Commit Message:
BACKENDS: NETWORKING: Don't handle request if it's not processing

This avoids an error when aborting a request which notifies on a
disappeared dialog and raises a SIGSEGV

Changed paths:
    backends/networking/curl/sessionrequest.cpp


diff --git a/backends/networking/curl/sessionrequest.cpp b/backends/networking/curl/sessionrequest.cpp
index 6b03f04087d..75b72a136fb 100644
--- a/backends/networking/curl/sessionrequest.cpp
+++ b/backends/networking/curl/sessionrequest.cpp
@@ -153,6 +153,10 @@ void SessionRequest::reuse(const Common::String &url, const Common::String &loca
 }
 
 void SessionRequest::handle() {
+	if (_state != PROCESSING) {
+		return;
+	}
+
 	if (!_stream) _stream = makeStream();
 
 	if (_stream) {
@@ -221,6 +225,8 @@ void SessionRequest::close() {
 }
 
 void SessionRequest::abortRequest() {
+	_state = FINISHED;
+
 	if (_localFile) {
 		_localFile->close();
 		delete _localFile;
@@ -228,7 +234,6 @@ void SessionRequest::abortRequest() {
 
 		// TODO we need to remove file, but there is no API
 	}
-	_state = FINISHED;
 }
 
 bool SessionRequest::complete() {




More information about the Scummvm-git-logs mailing list