removing DeleteFcn of all descendants to prevent infinite loop
2 次查看(过去 30 天)
显示 更早的评论
When trying to close my gui which contains a plot of several graphs, I encountered an error (below). This error repeated continuously (infinite loop of error) and I wanted to know how can I avoid it.
Here is my close request function:
function figure1_CloseRequestFcn(hObject, eventdata, handles)
AllMyTimers = timerfind('Tag', 'myTimers');
if ~isempty(AllMyTimers)
stop( AllMyTimers );
delete(AllMyTimers);
end
delete(hObject); % this is where the crash occures (2688 in figure1_CloseRequestFcn )
------ The error: -----
Warning: Too many objects created while deleting uipanel children; removing DeleteFcn of all descendants to prevent infinite loop.
> In MainGUI>figure1_CloseRequestFcn at 2688
In gui_mainfcn at 96
In MainGUI at 33
In @(hObject,eventdata)MainGUI('figure1_CloseRequestFcn',hObject,eventdata,guidata(hObject))
{Warning: Too many objects created while deleting uipanel children;
removing DeleteFcn of all descendants to prevent infinite loop}
> In MainGUI>figure1_CloseRequestFcn at 2688
In gui_mainfcn at 96
In MainGUI at 33
In @(hObject,eventdata)MainGUI('figure1_CloseRequestFcn',hObject,eventdata,guidata(hObject))
{Warning: Too many objects created while deleting uipanel children;
removing DeleteFcn of all descendants to prevent infinite loop}
...
and so on, infinitely.
4 个评论
Dhanya
2017-10-6
Hi, Was this problem solved. I too encountered a similar behavior and am looking for ways to solve it.
Jan
2017-10-6
@Dhanya: This thread could be solved, because Shahar did not show the code (although "I've added my figure1_CloseRequestFcn" seems to imply this). Without seeing the code, how could we suggest an improvement? So please open a new thread and add the details.
回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!