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 173443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:20:42+00:00 2026-05-11T13:20:42+00:00

I am using following single threaded appartment. I am unable to reclaim memory/other resources

  • 0

I am using following single threaded appartment. I am unable to reclaim memory/other resources from thread object. Actullay I want to wrap my thread in try catch and fianlly block. try and catch are done. But I am unsure about finally block. What code, property or function do I need to call in finally block.

System.Threading.Thread myThread = null;     try      {         myThread = new System.Threading.Thread(functionAddressETC)         myThread .SetApartmentState(System.Threading.ApartmentState.STA);         myThread .Start();         myThread .Join();     } catch(Exception ex) {} finally {    // I need help in finally block. I need to reclaim all my resources    //what function do i need to call here?????? } 
  • 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. 2026-05-11T13:20:42+00:00Added an answer on May 11, 2026 at 1:20 pm

    The GC will reclaim memory, finalizers will free native resources. The only way to ensure these processes happen is to ensure that objects you no longer need are unreferenced.

    A thread does not have any memory/resources of its own apart from its stack, which will be cleaned up by the Join shutting down the thread (unless you have something messing with duplicating native thread handles: in which case when the last handle is closed).

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

Sidebar

Related Questions

I am using following C function to create multiple network namespaces from a single
I am using following selector to remove single item in select. jQuery(#stateCity option[value='Adak, AK,
I'm using the following code to just make a single UILabel on my cell.
I am trying to create a table with a single column using the following
In Bash script, what is the difference between the following snippets? 1) Using single
I have a asp.net sitemap with single level dropdown menu. I am using following
I'm trying to query UserMetaData for a single record using the following query using
I am using the following insert statement within a tool pulling data from one
I am thinking of using following code, but I want to transfer hundreds of
I have coded a single threaded client server model which does following: Server loops

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.