Skip to content

Binding existing objects #25

Answered by gengyong
oschepkovdaniel asked this question in Q&A
Discussion options

You must be logged in to vote

define a "ctor" for it, return the object instance. the "ctor" accept one or two functor which for alloc and free the object, if you set deleter functor as null, the object will never be GC from lua, this behavior fit for most singleton patern.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@zazahunter
Comment options

Answer selected by gengyong
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #21 on June 22, 2022 00:03.