Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6978019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:42:06+00:00 2026-05-27T17:42:06+00:00

I have to work with legacy code. This code has a TTimer created in

  • 0

I have to work with legacy code. This code has a TTimer created in a main thread.
In OnTimer event the timer is checking periodically a state of some data in the worker thread.

pseudocode:

procedure MainForm.OnTimer(Sender: TObject);
begin
  if WorkerThread.Data.State = full then
  begin
    WorkerThread.Free; //This freezes GUI.    
  end else
   //Do something else.
end;

The problem is that I want to do some background operation when the WorkerThread is terminating. To avoid synchronization I’ve overriden DoTerminate method. However in this particular case, this is not helping and my GUI becomes frozen until the DoTerminate finishes.

Can I somehow avoid the freeze?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:42:07+00:00Added an answer on May 27, 2026 at 5:42 pm

    There’s not enough code here to say anything with any certainty. However, calling Free on a thread results in a call to Terminate followed by a WaitFor. It’s quite plausible that the wait is not returning which would be consistent with the frozen UI.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been assigned to work on some legacy C++ code in MFC. One
This one has be stumped. I'm doing some work on a legacy ASP.NET WebForms
I got some legacy code that has this: <?PHP if(isset($_GET['pagina'])==homepage) { ?> HtmlCode1 <?php
I have some legacy code with linq2sql classes. DataContext class has following definition for
I know this is a bad idea, but I have lots of legacy code
I work with legacy systems that have tens of thousand of lines of stored
I have to work on several VB6 legacy projects and despite some good VB6
At work we have a legacy process written in Visual C++ that basically consists
As you work in a legacy codebase what will have the greatest impact over
At my place of work we have a legacy document management system that for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.