Skip to content

Commit

Permalink
Merge pull request #45 from Live2D/develop
Browse files Browse the repository at this point in the history
Update to Cubism 4 SDK for Native R5_1
  • Loading branch information
itoh-at-live2d-com committed Sep 15, 2022
2 parents bb0d1b3 + 541c6f5 commit 47bec74
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## [4-r.5.1] - 2022-09-15

### Fixed

* Fix a bug that caused a crash if an empty array existed in json.


## [4-r.5] - 2022-09-08

### Added
Expand Down Expand Up @@ -219,6 +226,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
* Fix invalid expressions of `CubismCdiJson`.


[4-r.5.1]: https://github.com/Live2D/CubismNativeFramework/compare/4-r.5...4-r.5.1
[4-r.5]: https://github.com/Live2D/CubismNativeFramework/compare/4-r.5-beta.5...4-r.5
[4-r.5-beta.5]: https://github.com/Live2D/CubismNativeFramework/compare/4-r.5-beta.4.1...4-r.5-beta.5
[4-r.5-beta.4.1]: https://github.com/Live2D/CubismNativeFramework/compare/4-r.5-beta.4...4-r.5-beta.4.1
Expand Down
18 changes: 11 additions & 7 deletions src/Type/csmVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,14 +524,15 @@ class csmVector
*/
void Copy(const csmVector& c)
{
_size = c._size;
_capacity = c._capacity;

if (c._capacity == 0)
{
_ptr = NULL;
return;
}

_size = c._size;
_capacity = c._capacity;

_ptr = (T*)CSM_MALLOC(_capacity * sizeof(T));

for (csmInt32 i = 0; i < _size; ++i)
Expand Down Expand Up @@ -641,12 +642,15 @@ void csmVector<T>::PrepareCapacity(csmInt32 newSize)
template<class T>
void csmVector<T>::Clear()
{
for (csmInt32 i = 0; i < _size; i++)
if (_ptr != NULL)
{
_ptr[i].~T();
}
for (csmInt32 i = 0; i < _size; i++)
{
_ptr[i].~T();
}

CSM_FREE(_ptr);
CSM_FREE(_ptr);
}

_ptr = NULL;
_size = 0;
Expand Down

0 comments on commit 47bec74

Please sign in to comment.