Thread.Kill

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method

Thread.Kill()

New in 2005R5

Supported for all project types and targets.

Kills the specified thread.

Notes

Internally, this method will cause your thread’s stack to unwind, destructors for local objects to be called, and so forth. It's a graceful exit which can cause code to execute. It may also cause context switches.

fa-info-circle-32.png
A thread should not kill itself. Instead, just return from the Run event handler to allow the thread to terminate.

Example

This example, which is in the Action event of a button, kills the thread.

LongProcessThread1.Kill