File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,8 @@ osStatus Thread::start(mbed::Callback<void()> task)
113113 _tid = osThreadNew (Thread::_thunk, this , &_attr);
114114 if (_tid == nullptr ) {
115115 if (_dynamic_stack) {
116- delete[] _attr.stack_mem ;
116+ // Cast before deallocation as delete[] does not accept void*
117+ delete[] static_cast <uint32_t *>(_attr.stack_mem );
117118 _attr.stack_mem = nullptr ;
118119 }
119120 _mutex.unlock ();
@@ -417,7 +418,8 @@ Thread::~Thread()
417418 // terminate is thread safe
418419 terminate ();
419420 if (_dynamic_stack) {
420- delete[] _attr.stack_mem ;
421+ // Cast before deallocation as delete[] does not accept void*
422+ delete[] static_cast <uint32_t *>(_attr.stack_mem );
421423 _attr.stack_mem = nullptr ;
422424 }
423425}
You can’t perform that action at this time.
0 commit comments