Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fpGUI minor code improvement suggestions #128

Open
deanm73 opened this issue Jun 8, 2023 · 0 comments
Open

fpGUI minor code improvement suggestions #128

deanm73 opened this issue Jun 8, 2023 · 0 comments

Comments

@deanm73
Copy link

deanm73 commented Jun 8, 2023

These are small code improvements that might make the framework slightly more robust:

src/corelib/fpg_msgqueue.inc
procedure fpgInitMsgQueue;
after line "uMsgQueueList := TList.Create;"
add "uMsgQueueList.Capacity := cMessageQueueSize;"

procedure fpgDeliverMessage
replace "msg.Dest.Free"
with "FreeAndNil(msg.Dest)"

src/corelib/fpg_main.pas
procedure TfpgApplication.RunMessageLoop;
reduce timeout from "WaitWindowMessage(2000);"
to "WaitWindowMessage(100);"

src/corelib/fpg_widget.pas
procedure procedure TfpgWidget.MsgPaint
put code between "Canvas.BeginDraw;" and "Canvas.EndDraw" into try...finally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant