Skip to content

Commit

Permalink
Fix crash in release build
Browse files Browse the repository at this point in the history
  • Loading branch information
tustanivsky committed Feb 20, 2024
1 parent 3018b15 commit 4a27123
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions package-dev/Runtime/SentryInitialization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ private struct Il2CppStackFrameInfo
public int sourceCodeLineNumber;
public int ilOffset;

[MarshalAs(UnmanagedType.LPStr)]
public string filePath;
public IntPtr filePath;
}

private static void Il2CppNativeStackTraceCurrentThreadShim(out IntPtr addresses, out int numFrames, out string? imageUUID, out string? imageName)
{
// Currently there is no obvious way to obtain image UUID and name
var uuidBuffer = IntPtr.Zero;
var imageNameBuffer = IntPtr.Zero;

Expand All @@ -240,6 +240,8 @@ private static void Il2CppNativeStackTraceCurrentThreadShim(out IntPtr addresses
try
{
farameInfoPtr = Marshal.AllocHGlobal(Marshal.SizeOf<Il2CppStackFrameInfo>());

// Is it reliable to query current stack trace here?
var res = il2cpp_current_thread_get_frame_at(i, farameInfoPtr);
if(res)
{
Expand Down

0 comments on commit 4a27123

Please sign in to comment.