axmolengine / axmol

Axmol Engine – A Multi-platform Engine for Desktop, XBOX (UWP) and Mobile games. (A fork of Cocos2d-x-4.0)
https://axmol.dev
MIT License
922 stars 205 forks source link

Data::fastSet function logic changed #1369

Closed solan-solan closed 1 year ago

solan-solan commented 1 year ago

I used the function such a way:

image

Now, Data::_impl.attach_abi(...) will free memory inside _Tidy() through the _Alloc::reallocate, and returned pointer is invalidated. It does not look like expected behavior

image

(updated axmol up to 798689a6102e61e5da72821cda1cff69ba162a1b [798689a])

halx99 commented 1 year ago

use takeBuffer is better in your use case

solan-solan commented 1 year ago

yes, it will fit, thanks