Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequest.java

Issue 29397615: Issue 5053 - Release JsValues explicitly (Closed)
Patch Set: Created March 29, 2017, 12:12 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequest.java
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequest.java b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequest.java
index 29bcdc0f722e330411b6d92c7cb4e3cb0cd4f4c4..0d910801be3278d81c2c405a7c713dfe14fde71a 100644
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequest.java
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequest.java
@@ -31,6 +31,7 @@ import java.util.zip.GZIPInputStream;
import org.adblockplus.libadblockplus.AdblockPlusException;
import org.adblockplus.libadblockplus.FilterEngine;
import org.adblockplus.libadblockplus.HeaderEntry;
+import org.adblockplus.libadblockplus.JsValue;
import org.adblockplus.libadblockplus.ServerResponse;
import org.adblockplus.libadblockplus.ServerResponse.NsStatus;
import org.adblockplus.libadblockplus.WebRequest;
@@ -83,9 +84,32 @@ public class AndroidWebRequest extends WebRequest
{
for (final org.adblockplus.libadblockplus.Subscription s : engine.fetchAvailableSubscriptions())
{
- this.subscriptionURLs.add(s.getProperty("url").toString());
+ try
+ {
+ JsValue jsUrl = s.getProperty("url");
+ try
+ {
+ this.subscriptionURLs.add(jsUrl.toString());
+ }
+ finally
+ {
+ jsUrl.dispose();
+ }
+ }
+ finally
+ {
+ s.dispose();
+ }
+ }
+ JsValue jsPref = engine.getPref("subscriptions_exceptionsurl");
+ try
+ {
+ this.subscriptionURLs.add(jsPref.toString());
+ }
+ finally
+ {
+ jsPref.dispose();
}
- this.subscriptionURLs.add(engine.getPref("subscriptions_exceptionsurl").toString());
}
@Override

Powered by Google App Engine
This is Rietveld