DiagnosticsReferenceNew · 0.744
unregistercallback
Release a callback previously registered under a name.
Details#
Removes a matching name from the diagnostics callback registry and releases its retained function reference. Removing an unknown name is a normal false result rather than an error.
Signature#
unregistercallback(name: string): booleanParameters#
| Parameter | Type | Description |
|---|---|---|
name | string | Registry name used in registercallback; avoid embedded NUL bytes. |
Returns#
true if a registered reference was removed; false if the name was absent. A missing name raises an argument error.
Examples#
Removal is safe to repeat
registercallback("docs.cleanup-example", function() end)
print(unregistercallback("docs.cleanup-example")) -- true
print(unregistercallback("docs.cleanup-example")) -- false