1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 16:23:29 +00:00

dont null out disposed objects

This commit is contained in:
Kyle Spearrin
2017-02-23 23:12:39 -05:00
parent b960640e03
commit d766ffa040

View File

@@ -64,8 +64,6 @@ namespace Bit.Android
var testNodes = GetWindowNodes(root, e, n => n.ViewIdResourceName != null && n.Text != null, false); var testNodes = GetWindowNodes(root, e, n => n.ViewIdResourceName != null && n.Text != null, false);
var testNodesData = testNodes.Select(n => new { id = n.ViewIdResourceName, text = n.Text }); var testNodesData = testNodes.Select(n => new { id = n.ViewIdResourceName, text = n.Text });
testNodes.Dispose(); testNodes.Dispose();
testNodes = null;
testNodesData = null;
*/ */
var notificationManager = (NotificationManager)GetSystemService(NotificationService); var notificationManager = (NotificationManager)GetSystemService(NotificationService);
@@ -94,9 +92,9 @@ namespace Bit.Android
FillCredentials(usernameEditText, passwordNodes); FillCredentials(usernameEditText, passwordNodes);
allEditTexts.Dispose(); allEditTexts.Dispose();
allEditTexts = null; //allEditTexts = null;
usernameEditText.Dispose(); usernameEditText.Dispose();
usernameEditText = null; //usernameEditText = null;
} }
else else
{ {
@@ -109,7 +107,7 @@ namespace Bit.Android
} }
passwordNodes.Dispose(); passwordNodes.Dispose();
passwordNodes = null; //passwordNodes = null;
if(cancelNotification) if(cancelNotification)
{ {
@@ -121,9 +119,9 @@ namespace Bit.Android
} }
notificationManager?.Dispose(); notificationManager?.Dispose();
notificationManager = null; //notificationManager = null;
root.Dispose(); root.Dispose();
root = null; //root = null;
e.Dispose(); e.Dispose();
} }
@@ -143,7 +141,7 @@ namespace Bit.Android
{ {
uri = ExtractUri(uri, addressNode, SupportedBrowsers[root.PackageName]); uri = ExtractUri(uri, addressNode, SupportedBrowsers[root.PackageName]);
addressNode.Dispose(); addressNode.Dispose();
addressNode = null; //addressNode = null;
} }
} }
@@ -235,7 +233,7 @@ namespace Bit.Android
notificationManager.Notify(AutoFillNotificationId, builder.Build()); notificationManager.Notify(AutoFillNotificationId, builder.Build());
builder.Dispose(); builder.Dispose();
builder = null; //builder = null;
} }
private void FillCredentials(AccessibilityNodeInfo usernameNode, IEnumerable<AccessibilityNodeInfo> passwordNodes) private void FillCredentials(AccessibilityNodeInfo usernameNode, IEnumerable<AccessibilityNodeInfo> passwordNodes)