Index: content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java b/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java |
index b89205c7a688230a9fdc5c9e38f97c400ceb3c39..514ab6ae324d36872a47248a1e149b9712789aa7 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java |
@@ -242,6 +242,15 @@ public class TracingControllerAndroid { |
@Override |
protected void finalize() { |
+ // Ensure that destroy() was called. |
+ assert mNativeTracingControllerAndroid == 0; |
+ } |
+ |
+ /** |
+ * Clean up the C++ side of this class. |
+ * After the call, this class instance shouldn't be used. |
+ */ |
+ public void destroy() { |
if (mNativeTracingControllerAndroid != 0) { |
nativeDestroy(mNativeTracingControllerAndroid); |
mNativeTracingControllerAndroid = 0; |