You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CCASSERT(size >= 0, "fastSet size should be non-negative");
//CCASSERT(bytes, "bytes should not be nullptr");
_bytes = bytes;
_size = size;
}
fastSet makes the Data object managing a new memory area in [bytes, bytes + size), but it doesn't releasing the old data it manages. Failing to release the old data causes memory leak, as happens below,
cocos2d-x version: current v3 branch
cocos2d-x/cocos/base/CCData.cpp
Lines 127 to 133 in 4afda3a
fastSet
makes theData
object managing a new memory area in[bytes, bytes + size)
, but it doesn't releasing the old data it manages. Failing to release the old data causes memory leak, as happens below,cocos2d-x/cocos/base/CCUserDefault.cpp
Lines 324 to 334 in 4afda3a
Can be tested with the following example using valgrind
with the following
UserDefault.xml
file,The text was updated successfully, but these errors were encountered: