jacksondunstan / UnityNativeScripting

Unity Scripting in C++
https://jacksondunstan.com/articles/3938
MIT License
1.33k stars 135 forks source link

Crash in release build when returning a string from a method #60

Open SeleDreams opened 4 years ago

SeleDreams commented 4 years ago

Hi, I am working on a project and I found a weird issue that only happens in release build

I have a a function that returns a string image (Member is a string member I use quickly for this example but basically it happened with all my code) and it works in the editor, the string is properly returned and I can work with it, but when I test it in a standalone build, the game crashes immediatly when the function is called this is the log it generated when crashing

error.log

jacksondunstan commented 4 years ago

It's hard to tell what's happening here from just the small snippet of code and the error.log file. What is Member? How is this function being called?

I noticed you're using Unity 2017.2. While it's not strictly required, you may also benefit from upgrading to a newer, supported version.

SeleDreams commented 4 years ago

I think i'll make a small reproduction project to help you identify the issue.

I was using unity 2017 because I was creating a feature for a game under unity 2017.2.3

SeleDreams commented 4 years ago

image also if versions superior to 2017 are supported, it could be good to update the description