Questions tagged [terminate]

For questions regarding the termination of processes, threads, and sessions.

937 questions
9
votes
1 answer

What is the standard way to get a Rust thread out of blocking operations?

Coming from Java, I am used to idioms along the lines of while (true) { try { someBlockingOperation(); } catch (InterruptedException e) { Thread.currentThread.interrupt(); // re-set the interrupted flag cleanup(); // whatever is…
Harald
  • 4,575
  • 5
  • 33
  • 72
9
votes
1 answer

Kill Specified Task instead of Process in C#

Like Microsoft Word, If we open multiple Word windows, then we will find that they are under one process named WINWORD with multiple tasks under it. In task manager of Window 8.1 Pro, we can right click it and end it by End Task. I success to do…
V-SHY
  • 3,925
  • 4
  • 31
  • 47
9
votes
3 answers

How to terminate anonymous threads in Delphi on application close?

I have a Delphi application which spawns 6 anonymous threads upon some TTimer.OnTimer event. If I close the application from the X button in titlebar Access Violation at address $C0000005 is raised and FastMM reports leaked TAnonymousThread…
Gad D Lord
  • 6,620
  • 12
  • 60
  • 106
8
votes
5 answers

Why does iOS terminate my app even when I free lots of memory in response to memory warnings?

I can't figure out why iOS is terminating my app (iPad, iOS 4) due to memory usage even after I free a ton of memory in response to low-memory warnings. For example, here's a typical termination scenario, with me logging memory usage every so often…
Ben Hoyt
  • 10,694
  • 5
  • 60
  • 84
8
votes
2 answers

Is there a Delphi event that is guaranteed to be called when an app terminates but before any forms are destroyed?

I am using Delphi 6 Pro. I need an event that will fire when my application is definitely shutting down but before any Forms are destroyed. I thought about trapping WM_QUIT messages in the main form WndProc() but that didn't work because the Forms…
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
8
votes
2 answers

Stopping Python container is slow - SIGTERM not passed to python process?

I made a simple python webserver based on this example, which runs inside Docker FROM python:3-alpine WORKDIR /app COPY entrypoint.sh . RUN chmod +x entrypoint.sh COPY src src CMD ["python", "/app/src/api.py"] ENTRYPOINT…
Lion
  • 16,606
  • 23
  • 86
  • 148
8
votes
1 answer

Why does excel crash here?

Is there any reason the below crashes excel 2016? Option Explicit Option Compare Text Option Base 1 Sub p1() Dim t(1), w() t(1) = w If IsMissing(w) Then DoEvents If IsMissing(t(1)) Then DoEvents End Sub w is an uninitiated array,…
vbAdder
  • 659
  • 5
  • 12
8
votes
7 answers

How to break out of a sourced Bash script's function

I have a Bash script that is sourced. When this script is sourced, it runs a function in the Bash script. This function should terminate the script if a certain condition is matched. How can this be done without terminating the shell in which the…
d3pd
  • 7,935
  • 24
  • 76
  • 127
8
votes
6 answers

UIApplicationExitsOnSuspend anything else I'm missing?

So I know this has been beaten to death but I still can't figure out a solution. I have my UIApplicationExitsOnSuspend set to in the Info.plist and still both in the simulator as well as on an iPhone 4 device, the app goes into standby…
schone
  • 225
  • 1
  • 3
  • 10
8
votes
2 answers

Difference between os.execl() and os.execv() in python

Is there a difference between os.execl() and os.execv() in python? I was using os.execl(python, python, *sys.argv) to restart my script (from here). But it seems to start from where the previous script left. I want the script to start from the…
Rohin Kumar
  • 730
  • 2
  • 10
  • 24
8
votes
3 answers

Terminate subprocess in Windows, access denied

- import time import subprocess from os.path import expanduser chrome_path = expanduser('~\Local Settings\Application Data\Google\Chrome\Application\chrome.exe') proc = subprocess.Popen(chrome_path) time.sleep(4) proc.terminate() Output: …
Jesse Aldridge
  • 7,991
  • 9
  • 48
  • 75
8
votes
5 answers

Java program terminates unexpectedly without any error message

I have written a java program which needs to process thousands of text files (all needs to be loaded on memory). It works fine with as many as 123 input files, but when I run it to process around 5000 files, it terminates unexpectedly in the middle…
Fahim
  • 305
  • 2
  • 3
  • 14
8
votes
2 answers

How to debug iPhone app errors that occur before the first line

I have a fairly simple app. It compiles fine. Unfortunately, when I Build and Go, it fails before even the first line of code, thus making it impossible for me to even debug it. Where do I start? I do have the stack track though.
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
7
votes
4 answers

Stop execution without skipping destructors

Is it possible to terminate software execution without skipping calls to destructors? For instance, in the code below, the destructor for test will never be called because of the exit(1) statement. #include #include using…
Malabarba
  • 4,473
  • 2
  • 30
  • 49
7
votes
2 answers

A kinder way than TerminateProcess?

I have a backup app that will close user-defined running programs before the backup so that open data files can be closed and flushed before the backup. After the backup is complete it restarts the programs in the list. I have no problem getting the…
user568160
  • 91
  • 2