Properly revert cursor when using set_custom_mouse_cursor with null

Fixes #32486
This commit is contained in:
PouleyKetchoupp
2019-10-03 13:02:11 +02:00
parent 09bf1b35c0
commit 5bfe32eaa4
4 changed files with 16 additions and 2 deletions

View File

@ -2485,11 +2485,16 @@ void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shap
DeleteObject(bitmap);
} else {
// Reset to default system cursor
cursors[p_shape] = NULL;
if (cursors[p_shape]) {
DestroyIcon(cursors[p_shape]);
cursors[p_shape] = NULL;
}
CursorShape c = cursor_shape;
cursor_shape = CURSOR_MAX;
set_cursor_shape(c);
cursors_cache.erase(p_shape);
}
}