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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:42:59+00:00 2026-05-13T14:42:59+00:00

I have a simple program that has backgroundworkers, and it runs with no stop,

  • 0

I have a simple program that has backgroundworkers, and it runs with no stop, and no matter when I close it, it will always have some still running (or all of them) and I’ve noticed that closing the application doesn’t completly kill it. After running it some times, there are processes (1 for each run) that remain on the process tab of the windows task manager.

Why do they remain? what do I do for them not to ?

ps.: I’ve read questions about backgroundworker’s behavour in application closing, but I guess it’s not acting as intended then. Any suggestions ?

  • 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-13T14:42:59+00:00Added an answer on May 13, 2026 at 2:42 pm

    A better approach is to stop / kill the thread using an event or custom action before applicaion in closed.

    like as follows

    private void ButtonStopBGWorker_Click(object sender, RoutedEventArgs e)
    {
     BackgroundWorker worker = sender as BackgroundWorker;
     if ((worker.CancellationPending == true))
       {
          e.Cancel = true;
          break;
       }
    }
    

    This post at the forum will give you more insight.
    Also, have a look at MSDN for details about how to manage Backgroundworker Threads

    Hope it helps

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

Sidebar

Related Questions

I have a simple Tray icon program that opens a site using System.Diagnostics.Process.Start(URL) And
I have two simple while loops in my program that I feel ought to
I have a relatively simple select statement in a VB6 program that I have
I have a simple script which is used to start another program. This other
Have a look at this very simple example WPF program: <Window x:Class=WpfApplication1.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
I have the need to express simple conditionals as program input. The input must
I have a script that appends some rows to a table. One of the
Does anyone have sample code to copy open (in-use and locked by another program)
I have simple regex \.*\ for me its says select everything between and ,
Ok, i have simple scenario: have two pages: login and welcome pages. im using

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.