Skip to content
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#

Luau
unregistercallback(name: string): boolean

Parameters#

ParameterTypeDescription
namestringRegistry 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

Luau
registercallback("docs.cleanup-example", function() end)
print(unregistercallback("docs.cleanup-example")) -- true
print(unregistercallback("docs.cleanup-example")) -- false