[hg] main-silver: #228361 - Memory leak in editor.lib2.highlight...

  • From: Miloslav Metelka < >
  • To: , ,
  • Subject: [hg] main-silver: #228361 - Memory leak in editor.lib2.highlight...
  • Date: Fri, 26 Apr 2013 11:10:54 -0700

changeset 6be44a010dd9 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/6be44a010dd9
description:
        #228361 - Memory leak in editor.lib2.highlighting.SyntaxHighlighting.

diffstat:

 
editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/SyntaxHighlighting.java
       |  2 +-
 
html.editor/src/org/netbeans/modules/html/editor/coloring/EmbeddingHighlightsContainer.java
 |  6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diffs (37 lines):

diff --git 
a/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/SyntaxHighlighting.java
 
b/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/SyntaxHighlighting.java
--- 
a/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/SyntaxHighlighting.java
+++ 
b/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/SyntaxHighlighting.java
@@ -656,7 +656,7 @@
             // since "random" lookup events translate into highlight change 
events
             // that are monitored by tests and so the tests may then fail
             if (TEST_FALLBACK_COLORING == null) {
-                result.addLookupListener(this);
+                
result.addLookupListener(WeakListeners.create(LookupListener.class, this, 
result));
             }
             updateFCS();
         }
diff --git 
a/html.editor/src/org/netbeans/modules/html/editor/coloring/EmbeddingHighlightsContainer.java
 
b/html.editor/src/org/netbeans/modules/html/editor/coloring/EmbeddingHighlightsContainer.java
--- 
a/html.editor/src/org/netbeans/modules/html/editor/coloring/EmbeddingHighlightsContainer.java
+++ 
b/html.editor/src/org/netbeans/modules/html/editor/coloring/EmbeddingHighlightsContainer.java
@@ -98,17 +98,19 @@
     private long version = 0;
     
     private Result<FontColorSettings> lookupResult;
+    private LookupListener lookupListener;
 
     EmbeddingHighlightsContainer(Document document) {
         this.document = document;
 
         lookupResult = 
MimeLookup.getLookup(HTML_MIME_TYPE).lookupResult(FontColorSettings.class);
-        lookupResult.addLookupListener(new LookupListener() {
+        
lookupResult.addLookupListener(WeakListeners.create(LookupListener.class,
+                lookupListener = new LookupListener() {
             @Override
             public void resultChanged(LookupEvent ev) {
                 refreshColorings();
             }
-        });
+        }, lookupResult));
         refreshColorings();
     }
     

[hg] main-silver: #228361 - Memory leak in editor.lib2.highlight...

Miloslav Metelka 04/26/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close