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)
113
113
_tid = osThreadNew (Thread::_thunk, this , &_attr);
114
114
if (_tid == nullptr ) {
115
115
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 );
117
118
_attr.stack_mem = nullptr ;
118
119
}
119
120
_mutex.unlock ();
@@ -417,7 +418,8 @@ Thread::~Thread()
417
418
// terminate is thread safe
418
419
terminate ();
419
420
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 );
421
423
_attr.stack_mem = nullptr ;
422
424
}
423
425
}
You can’t perform that action at this time.
0 commit comments