Skip to content

Commit 8679f7b

Browse files
committedDec 25, 2014
将软引用改为弱引用
1 parent 40d9b35 commit 8679f7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎library/src/main/java/cn/pedant/SafeWebViewBridge/JsCallback.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ public class JsCallback {
1717
private static final String CALLBACK_JS_FORMAT = "javascript:%s.callback(%d, %d %s);";
1818
private int mIndex;
1919
private boolean mCouldGoOn;
20-
private SoftReference<WebView> mWebViewRef;
20+
private WeakReference<WebView> mWebViewRef;
2121
private int mIsPermanent;
2222
private String mInjectedName;
2323

2424
public JsCallback (WebView view, String injectedName, int index) {
2525
mCouldGoOn = true;
26-
mWebViewRef = new SoftReference<WebView>(view);
26+
mWebViewRef = new WeakReference<WebView>(view);
2727
mInjectedName = injectedName;
2828
mIndex = index;
2929
}
@@ -62,4 +62,4 @@ public JsCallbackException (String msg) {
6262
super(msg);
6363
}
6464
}
65-
}
65+
}

0 commit comments

Comments
 (0)
Please sign in to comment.