1
\$\begingroup\$

Hello I'm using SDL with C++ and I got this code:

void handleEvents() { SDL_Finger* finger = SDL_GetTouchFinger(SDL_GetTouchDevice(0), 0); } 

I do not know what SDL does inside the GetTouch function, maybe it allocates memory. Do I have to "destroy" finger here? Or will it be deleted by the end of the methods scope? Thank you.

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

From a quick glance at the SDL wiki at the function you provided, it says:

"The returned resource is owned by SDL and should not be deallocated."

from - https://wiki.libsdl.org/SDL_GetTouchFinger

Therefor, you shouldn't need to worry about destroying the object, SDL will manage it for you.

\$\endgroup\$
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.