Search Unity

iPhone crash if plugin included

Discussion in 'iOS and tvOS' started by bisc67, Apr 11, 2018.

  1. bisc67

    bisc67

    Joined:
    Apr 22, 2016
    Posts:
    8
    I have a plugin, written in C/C++, that I've been using on the Android platform.
    I'm running in to an odd problem; if the plugin is included in Unity, Unity will crash when loading a new scene.

    A function in the plugin is being called, it's a renderer::~renderer() destructor; but there is NO code reference within any scripts to the plugin, other than a single DLLExport line.

    It *only* crashes if I use __Internal as the DLL name, I'd prefer to use a dylib, but I can't seem to find any examples on how to properly attach a dylib.

    If I remove the DLLExport, it does not crash.

    I searched to confirm I have all the right compile options; but there's very little information available on this. I'm building for ARM64 platform, and have confirmed the .a is definitely the right type. There was mention of disabling thumb, but that refers only to ARM32 platforms. Anyway, when I added the -mno-thumb option, llvm compiler just complains.

    I've looked at the call stack of the crash, it appears to be happening on a cleanup operation.

    Callstack shows it's inside 'BatchDeleteObjects' and shows a 'clean' call to Renderer::~Renderer() (e.g. it doesn't appear to have been called by any of the other code); I see a message indicating the destructor has been called (but no message about the constructor being called).

    Any help would be greatly appreciated,

    Bisc.

    Xcode output below.

    Screen Shot 2018-04-11 at 1.16.42 PM.png
     
    Last edited: Apr 11, 2018