diff options
author | Colin Snover | 2017-12-05 11:24:39 -0600 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-18 16:30:05 +0200 |
commit | d43732ac47bacab53578c6217cb4dbd42da6b9c6 (patch) | |
tree | 0a4227c6ef48564a2e702a20adced010ee74dbda /backends | |
parent | 481b608c51858d0b6afc3cfb461664fc9575c6a0 (diff) | |
download | scummvm-rg350-d43732ac47bacab53578c6217cb4dbd42da6b9c6.tar.gz scummvm-rg350-d43732ac47bacab53578c6217cb4dbd42da6b9c6.tar.bz2 scummvm-rg350-d43732ac47bacab53578c6217cb4dbd42da6b9c6.zip |
IOS: Replace strdup with Common::String
Diffstat (limited to 'backends')
-rw-r--r-- | backends/platform/ios7/ios7_osys_main.cpp | 5 | ||||
-rw-r--r-- | backends/platform/ios7/ios7_osys_main.h | 3 | ||||
-rw-r--r-- | backends/platform/ios7/ios7_osys_video.mm | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/backends/platform/ios7/ios7_osys_main.cpp b/backends/platform/ios7/ios7_osys_main.cpp index 90c294a7d5..118ac22dae 100644 --- a/backends/platform/ios7/ios7_osys_main.cpp +++ b/backends/platform/ios7/ios7_osys_main.cpp @@ -111,7 +111,7 @@ OSystem_iOS7::OSystem_iOS7() : _screenOrientation(kScreenOrientationFlippedLandscape), _mouseClickAndDragEnabled(false), _gestureStartX(-1), _gestureStartY(-1), _fullScreenIsDirty(false), _fullScreenOverlayIsDirty(false), _mouseDirty(false), _timeSuspended(0), _lastDragPosX(-1), _lastDragPosY(-1), _screenChangeCount(0), - _lastErrorMessage(NULL), _mouseCursorPaletteEnabled(false), _gfxTransactionError(kTransactionSuccess) { + _mouseCursorPaletteEnabled(false), _gfxTransactionError(kTransactionSuccess) { _queuedInputEvent.type = Common::EVENT_INVALID; _touchpadModeEnabled = !iOS7_isBigDevice(); #ifdef IPHONE_SANDBOXED @@ -352,8 +352,7 @@ void OSystem_iOS7::logMessage(LogMessageType::Type type, const char *message) { output = stderr; if (type == LogMessageType::kError) { - free(_lastErrorMessage); - _lastErrorMessage = strdup(message); + _lastErrorMessage = message; } fputs(message, output); diff --git a/backends/platform/ios7/ios7_osys_main.h b/backends/platform/ios7/ios7_osys_main.h index 9b9d2bdee0..c57d95bdd2 100644 --- a/backends/platform/ios7/ios7_osys_main.h +++ b/backends/platform/ios7/ios7_osys_main.h @@ -27,6 +27,7 @@ #include "backends/platform/ios7/ios7_common.h" #include "backends/base-backend.h" #include "common/events.h" +#include "common/str.h" #include "audio/mixer_intern.h" #include "backends/fs/posix/posix-fs-factory.h" #include "graphics/colormasks.h" @@ -109,7 +110,7 @@ protected: bool _fullScreenOverlayIsDirty; int _screenChangeCount; - char *_lastErrorMessage; + Common::String _lastErrorMessage; #ifdef IPHONE_SANDBOXED Common::String _chrootBasePath; diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm index 30f8950ec6..730715d2a1 100644 --- a/backends/platform/ios7/ios7_osys_video.mm +++ b/backends/platform/ios7/ios7_osys_video.mm @@ -52,8 +52,8 @@ static void displayAlert(void *ctx) { } void OSystem_iOS7::fatalError() { - if (_lastErrorMessage) { - dispatch_async_f(dispatch_get_main_queue(), _lastErrorMessage, displayAlert); + if (_lastErrorMessage.size()) { + dispatch_async_f(dispatch_get_main_queue(), (void *)_lastErrorMessage.c_str(), displayAlert); for(;;); } else { |