Skip to content

Commit 18f4114

Browse files
konraddysputvlussenburglysannep
authored
Version 3.7.3 (#145)
* Do not test native client on not supported platforms * Invalid cast (#144) * prevent monitor disposing in the disable method (#143) * Use game object name instead of 'backtrace' * Version update + make sure backtrace-unity don't throw an exception when disk is full * Typo * Changelog * Add attributes to runtime xception Co-authored-by: Vincent Lussenburg <[email protected]> Co-authored-by: Lysanne Pinto <[email protected]>
1 parent a8138c2 commit 18f4114

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Backtrace Unity Release Notes
22

3+
## Version 3.7.3
4+
5+
Bugfixes
6+
- Fixed the game object name issue used by native integration when ANR or background exception occured,
7+
- fixed invalid cast in the screenshot generation algorithm,
8+
- fixed a problem with the dispose method in the Backtrace Android native integration - now backtrace-unity will dispose native integation only once.
9+
- prevent from throwing an exception from the BacktraceDatabase object if BacktraceDatabaseAttachments object generates attachment and disk is full.
10+
11+
312
## Version 3.7.2
413

514
Bugfixes

Runtime/BacktraceClient.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Backtrace.Unity
2424
/// </summary>
2525
public class BacktraceClient : MonoBehaviour, IBacktraceClient
2626
{
27-
public const string VERSION = "3.7.2";
27+
public const string VERSION = "3.7.3";
2828
internal const string DefaultBacktraceGameObjectName = "BacktraceClient";
2929
public BacktraceConfiguration Configuration;
3030

@@ -993,7 +993,9 @@ internal void HandleUnhandledExceptionsFromAndroidBackgroundThread(string backgr
993993
var stackTrace = backgroundExceptionMessage.Substring(splitIndex);
994994
if (Database != null)
995995
{
996-
Database.Add(new BacktraceReport(new BacktraceUnhandledException(message, stackTrace)).ToBacktraceData(null, GameObjectDepth));
996+
var backtraceData = new BacktraceReport(new BacktraceUnhandledException(message, stackTrace)).ToBacktraceData(null, GameObjectDepth);
997+
AttributeProvider.AddAttributes(backtraceData.Attributes.Attributes);
998+
Database.Add(backtraceData);
997999
}
9981000
else
9991001
{

Runtime/Model/Database/BacktraceDatabaseAttachmentManager.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,16 @@ public IEnumerable<string> GetReportAttachments(BacktraceData data)
3131
var attachmentPrefix = data.UuidString;
3232

3333
var result = new List<string>();
34-
AddIfPathIsNotEmpty(result, GetScreenshotPath(attachmentPrefix));
35-
AddIfPathIsNotEmpty(result, GetUnityPlayerLogFile(data, attachmentPrefix));
36-
AddIfPathIsNotEmpty(result, GetMinidumpPath(data, attachmentPrefix));
34+
try
35+
{
36+
AddIfPathIsNotEmpty(result, GetScreenshotPath(attachmentPrefix));
37+
AddIfPathIsNotEmpty(result, GetUnityPlayerLogFile(data, attachmentPrefix));
38+
AddIfPathIsNotEmpty(result, GetMinidumpPath(data, attachmentPrefix));
39+
}
40+
catch (Exception e)
41+
{
42+
Debug.LogWarning(string.Format("Cannot generate report attachments. Reason: {0}", e.Message));
43+
}
3744
return result;
3845
}
3946

@@ -100,7 +107,7 @@ private string GetScreenshotPath(string dataPrefix)
100107
{
101108
Texture2D result;
102109

103-
float ratio = Screen.width / Screen.height;
110+
float ratio = (float)Screen.width / (float)Screen.height;
104111
var applyDefaultSettings = ScreenshotMaxHeight == Screen.height;
105112
int targetHeight = applyDefaultSettings ? Screen.height : Mathf.Min(Screen.height, ScreenshotMaxHeight);
106113
int targetWidth = applyDefaultSettings ? Screen.width : Mathf.RoundToInt(targetHeight * ratio);

Runtime/Native/Android/NativeClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,11 @@ private void HandleUnhandledExceptions()
158158
const string callbackName = "HandleUnhandledExceptionsFromAndroidBackgroundThread";
159159
try
160160
{
161-
_unhandledExceptionWatcher = new AndroidJavaObject(_unhandledExceptionPath, "Backtrace", callbackName);
161+
_unhandledExceptionWatcher = new AndroidJavaObject(_unhandledExceptionPath, GameObjectName, callbackName);
162162
}
163163
catch (Exception e)
164164
{
165165
Debug.LogWarning(string.Format("Cannot initialize unhandled exception watcher - reason: {0}", e.Message));
166-
_enabled = false;
167166
}
168167
}
169168

@@ -397,7 +396,6 @@ public void HandleAnr()
397396
catch (Exception e)
398397
{
399398
Debug.LogWarning(string.Format("Cannot initialize ANR watchdog - reason: {0}", e.Message));
400-
_enabled = false;
401399
}
402400

403401
if (!CaptureNativeCrashes)
@@ -504,11 +502,13 @@ public override void Disable()
504502
{
505503
_anrWatcher.Call("stopMonitoring");
506504
_anrWatcher.Dispose();
505+
_anrWatcher = null;
507506
}
508507
if (_unhandledExceptionWatcher != null)
509508
{
510509
_unhandledExceptionWatcher.Call("stopMonitoring");
511510
_unhandledExceptionWatcher.Dispose();
511+
_unhandledExceptionWatcher = null;
512512
}
513513
base.Disable();
514514
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "io.backtrace.unity",
33
"displayName": "Backtrace",
4-
"version": "3.7.2",
4+
"version": "3.7.3",
55
"unity": "2017.1",
66
"description": "Backtrace's integration with Unity games allows customers to capture and report handled and unhandled Unity exceptions to their Backtrace instance, instantly offering the ability to prioritize and debug software errors.",
77
"keywords": [

0 commit comments

Comments
 (0)