IDE: Prevent high CPU load caused by exception + message dialog. Issue #41019.

This commit is contained in:
Juha 2024-07-12 22:59:17 +03:00
parent 76c4dc085a
commit e5a90cb7e3
2 changed files with 3 additions and 2 deletions

View File

@ -915,7 +915,7 @@ resourcestring
+'is inherited from %s.%sTo rename an inherited component open the '
+'ancestor and rename it there.';
lisUnableToFindMethod = 'Unable to find method.';
lisUnableToCreateNewMethod = 'Unable to create new method.';
//lisUnableToCreateNewMethod = 'Unable to create new method.';
lisUnableToShowMethod = 'Unable to show method.';
lisPleaseFixTheErrorInTheMessageWindow = 'Please fix the error shown in the'
+' message window which is normally below the source editor.';

View File

@ -13321,7 +13321,8 @@ begin
end else begin
DebugLn(['Error: (lazarus) TMainIDE.PropHookCreateMethod failed adding method "'+ShortMethodName+'" to source']);
DoJumpToCodeToolBossError;
raise Exception.Create(lisUnableToCreateNewMethod+' '+lisPleaseFixTheErrorInTheMessageWindow);
//Firing the exception twice + its handling message dialog causes high CPU load. Issue #41019.
//raise Exception.Create(lisUnableToCreateNewMethod+' '+lisPleaseFixTheErrorInTheMessageWindow);
end;
finally
OpenEditorsOnCodeToolChange:=OldChange;