LuaSTG-x Core API
ffi::callback Class Reference

Public Member Functions

function free ()
 
function set (local func)
 

Detailed Description

The C types for callbacks have some extra methods

Member Function Documentation

◆ free()

function free ( )

Free the resources associated with a callback. The associated Lua function is unanchored and may be garbage collected. The callback function pointer is no longer valid and must not be called anymore (it may be reused by a subsequently created callback).

◆ set()

function set ( local  func)

Associate a new Lua function with a callback. The C type of the callback and the callback function pointer are unchanged.

This method is useful to dynamically switch the receiver of callbacks without creating a new callback each time and registering it again (e.g. with a GUI library).


The documentation for this class was generated from the following file: