Can |setappdata| cause a memory leak if not cleared explicitly?
1 次查看(过去 30 天)
显示 更早的评论
I'd like to know if I should explicitly call rmappdata on anything stored using setappdata before the relevant object is deleted to avoid filling up my memory, or do these variables get "garbage-collected" on their own?
According to my test on R2017b@Win10 (code below) this memory is indeed freed, but is this behavior documented somewhere? Is it the same across all supported operating systems and MATLAB versions?
hFig = uifigure;
setappdata(hFig, 'NOISE', randi(5,40001));
delete(hFig);
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Maintain or Transition figure-Based Apps 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!