Skip to content

Fix nogc_trydelete for extern(C++) classes, would cause build error.#20

Merged
LunaTheFoxgirl merged 1 commit intoInochi2D:mainfrom
p0nce:extern-cpp-trydelete
Nov 20, 2025
Merged

Fix nogc_trydelete for extern(C++) classes, would cause build error.#20
LunaTheFoxgirl merged 1 commit intoInochi2D:mainfrom
p0nce:extern-cpp-trydelete

Conversation

@p0nce
Copy link
Copy Markdown
Contributor

@p0nce p0nce commented Nov 20, 2025

The problem this is fixing is: "you can't nogc_trydelete an extern(C++) class."

To reproduce before fix:

unittest
{
    extern(C++) static class A
    {
        int b;
    }

    A a = nogc_trynew!A();
    nogc_trydelete!A(a);
}

The issue was: instantiating wrong template + no bool result. Hereby assuming cpp_delete never fails.

To reproduce before fix:

unittest
{
    extern(C++) static class A
    {
        int b;
    }

    A a = nogc_trynew!A();
    nogc_trydelete!A(a);
}

The issue was: instantiating wrong template + no bool result. Hereby assuming cpp_delete never fails.
@LunaTheFoxgirl LunaTheFoxgirl merged commit caf6726 into Inochi2D:main Nov 20, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants