From d66c8ab7dca1ca6aec35932272858e1c215ad710 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Wed, 24 Jul 2024 15:12:32 +0300 Subject: [PATCH] fix: IL2CPP in Unity 6 (#1735) * fix: IL2CPP in Unity 6 * Update changelog * Update CHANGELOG.md Co-authored-by: Stefan Jandl --------- Co-authored-by: Stefan Jandl --- CHANGELOG.md | 1 + package-dev/Runtime/SentryInitialization.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdeab607b..7c9f228b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ## Fixes - The SDK no longer causes games to crash out of the box on platforms that have disk access restrictions (i.e. Nintendo Switch) ([#1728](https://github.com/getsentry/sentry-unity/pull/1728)) +- The SDK no longer causes crashes on Unity 6 in an attempt to provide line numbers ([#1735](https://github.com/getsentry/sentry-unity/pull/1735)) ### Dependencies diff --git a/package-dev/Runtime/SentryInitialization.cs b/package-dev/Runtime/SentryInitialization.cs index f44875c77..c786d8e96 100644 --- a/package-dev/Runtime/SentryInitialization.cs +++ b/package-dev/Runtime/SentryInitialization.cs @@ -200,7 +200,7 @@ void SwapHexByte(IntPtr buffer, Int32 offset1, Int32 offset2) return Marshal.PtrToStringAnsi(debugIdPtr); } -#if UNITY_2023 +#if UNITY_2023_1_OR_NEWER private static IntPtr Il2CppGcHandleGetTargetShim(IntPtr gchandle) => il2cpp_gchandle_get_target(gchandle); // Available in Unity `2013.3.12f1` (and later)