natiny.window.destroy
natiny.window.destroy(win)
Destroys a window and frees its resources.
Parameters
| Name | Type | Description |
|---|---|---|
win |
number |
Window handle from natiny.window.create |
Example
local win = natiny.window.create("Temp", 400, 300)
-- ...
natiny.window.destroy(win)
Notes
natiny.window.get_alivereportsfalsefrom this call onward, and the handle never resolves again - a later window reusing its place gets a handle of its own.- Called from inside
natiny.backend.loop, the window is released at the next frame boundary rather than in the middle of the frame that asked. - The loop keeps running as long as another window is open. Only destroying the last one ends it.