function lf_clearBlockCallbackStruct(~,~)
%lf_clearBlockCallbackStruct Listener called on a Ctrl+D error.

%   Copyright 2008-2014 The MathWorks, Inc.


clear global modelBlockStruct;
% Uncomment code below to enable access to block handles after Ctrl+D
clear global modelHandleStruct;

modelHandle = get_param(bdroot,'Handle');
codertarget.resourcemanager.resetAllResources(getActiveConfigSet(modelHandle), true);
lf_removeEngineEventListener(modelHandle, 'EnginePostBlock',  @lf_updateBlockCallbackStruct);
lf_removeEngineEventListener(modelHandle, 'EngineCompFailed', @lf_clearBlockCallbackStruct);
