MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / call_native_deleter

Function call_native_deleter

Source/Utils/dukglue/detail_constructor.h:55–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53
54 template<typename Cls>
55 static duk_ret_t call_native_deleter(duk_context* ctx)
56 {
57 duk_push_this(ctx);
58 duk_get_prop_string(ctx, -1, "\xFF" "obj_ptr");
59
60 if (!duk_is_pointer(ctx, -1)) {
61 duk_error(ctx, DUK_RET_REFERENCE_ERROR, "Object has already been invalidated; cannot delete.");
62 return DUK_RET_REFERENCE_ERROR;
63 }
64
65 Cls* obj = static_cast<Cls*>(duk_require_pointer(ctx, -1));
66 dukglue_invalidate_object(ctx, obj);
67 delete obj;
68
69 duk_pop_2(ctx);
70 return 0;
71 }
72 }
73}

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected