@@ -169,11 +169,13 @@ namespace SDL {
169
169
170
170
Cursor::Cursor () {
171
171
this ->cursor = SDL_CreateSystemCursor (SDL_SYSTEM_CURSOR_ARROW);
172
+ this ->has_control = true ;
172
173
}
173
174
174
175
Cursor::Cursor (Cursor&& other) {
175
176
this ->cursor = other.cursor ;
176
177
other.has_control = false ;
178
+ this ->has_control = true ;
177
179
}
178
180
179
181
Cursor::Cursor (
@@ -196,13 +198,15 @@ namespace SDL {
196
198
return {false , *current_element};
197
199
}
198
200
);
201
+ this ->has_control = true ;
199
202
}
200
203
201
204
Cursor::Cursor (
202
205
const std::initializer_list<std::string> l,
203
206
const Vector2s c
204
207
) {
205
208
this ->cursor = string_list_to_cursor (l, c);
209
+ this ->has_control = true ;
206
210
}
207
211
208
212
Cursor::Cursor (
@@ -236,22 +240,26 @@ namespace SDL {
236
240
}
237
241
}
238
242
);
243
+ this ->has_control = true ;
239
244
}
240
245
241
246
Cursor::Cursor (const std::string s, const Vector2s c) {
242
247
this ->cursor = string_list_to_cursor (_implementation::cursor::split (s), c);
248
+ this ->has_control = true ;
243
249
}
244
250
245
251
Cursor::Cursor (Surface& s, Vector2s c) {
246
252
this ->cursor = SDL_CreateColorCursor (s.sdl_surface , c[0 ], c[1 ]);
253
+ this ->has_control = true ;
247
254
}
248
255
249
256
Cursor::Cursor (const SDL_SystemCursor c) {
250
257
this ->cursor = SDL_CreateSystemCursor (c);
258
+ this ->has_control = true ;
251
259
}
252
260
253
261
Cursor::~Cursor () {
254
- if (this ->has_control )
262
+ if (this ->has_control ) // We don't want to free cursors that were moved.
255
263
SDL_FreeCursor (this ->cursor );
256
264
}
257
265
0 commit comments