summaryrefslogtreecommitdiffstats
path: root/platform/osx
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-10-03 13:39:25 +0200
committerGitHub <noreply@github.com>2019-10-03 13:39:25 +0200
commit9a115ccaf3dd0224de0e5b1a2d116e53b6fabffb (patch)
tree9d6106ff824a1cdadd2fbd247188af7ce5da351a /platform/osx
parent77b1214a9a63efdd6e3cf6772965777cc06408bb (diff)
parent5bfe32eaa4b2254b48f39bde3e7bb6055eae9b83 (diff)
downloadredot-engine-9a115ccaf3dd0224de0e5b1a2d116e53b6fabffb.tar.gz
Merge pull request #32518 from nekomatata/fix-revert-cursor
Properly revert cursor when using set_custom_mouse_cursor with null
Diffstat (limited to 'platform/osx')
-rw-r--r--platform/osx/os_osx.mm7
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index f48d4a307d..d30cb1c092 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1973,11 +1973,16 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
[nsimage release];
} else {
// Reset to default system cursor
- cursors[p_shape] = NULL;
+ if (cursors[p_shape] != NULL) {
+ [cursors[p_shape] release];
+ cursors[p_shape] = NULL;
+ }
CursorShape c = cursor_shape;
cursor_shape = CURSOR_MAX;
set_cursor_shape(c);
+
+ cursors_cache.erase(p_shape);
}
}