Index: test/FilterEngine.cpp |
diff --git a/test/FilterEngine.cpp b/test/FilterEngine.cpp |
index 177c0c7f2147850c3d846786858b9817c14155b3..fb7250114625dbbf6464614502a32d9d0e661cb1 100644 |
--- a/test/FilterEngine.cpp |
+++ b/test/FilterEngine.cpp |
@@ -533,3 +533,17 @@ TEST_F(FilterEngineTest, ElemhideWhitelisting) |
"http://example.co.uk", |
documentUrls1)); |
} |
+ |
+TEST(NewFilterEngineTest, MemoryLeak_NoCircularReferences) |
+{ |
+ std::weak_ptr<AdblockPlus::JsEngine> weakJsEngine; |
+ { |
+ auto jsEngine = AdblockPlus::JsEngine::New(); |
+ weakJsEngine = jsEngine; |
+ jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new LazyFileSystem())); |
+ jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new LazyWebRequest())); |
+ jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new LazyLogSystem())); |
+ auto filterEngine = FilterEnginePtr(new AdblockPlus::FilterEngine(jsEngine)); |
+ } |
+ EXPECT_FALSE(weakJsEngine.lock()); |
+} |