Bug 553334 - [Exception... 'Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsINavHistoryResult.removeObserver]' when adding a new folder. r=mak.
authorAsaf Romano <aromano@mozilla.com>
Fri, 04 Jun 2010 22:53:08 +0300
changeset 43103 979fbcd8bb298f5272d459743fb427b8086e4205
parent 43102 2ed1eee89a4c25291590b1984d5a9e98d22a4c48
child 43104 ddd93345ad4896c3165e36f83c76e6a8f68ef8ed
push id13618
push useraromano@mozilla.com
push dateFri, 04 Jun 2010 19:53:47 +0000
treeherdermozilla-central@979fbcd8bb29 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs553334
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 553334 - [Exception... 'Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsINavHistoryResult.removeObserver]' when adding a new folder. r=mak.
browser/components/places/content/tree.xml
--- a/browser/components/places/content/tree.xml
+++ b/browser/components/places/content/tree.xml
@@ -109,34 +109,31 @@
           this.load([query], options);
         ]]></body>
       </method>
 
       <method name="load">
         <parameter name="queries"/>
         <parameter name="options"/>
         <body><![CDATA[
-          // Cleanup old result if exists.
-          let oldResult = this.result;
-          if (oldResult) {
-            oldResult.removeObserver(this.view);
-            oldResult.root.containerOpen = false;
-          }
-
           let result = PlacesUtils.history
                                   .executeQueries(queries, queries.length,
                                                   options);
           let callback;
           if (this.flatList) {
             let onOpenFlatContainer = this.onOpenFlatContainer;
             if (onOpenFlatContainer)
               callback = new Function("aContainer", onOpenFlatContainer);
           }
 
           let treeView = new PlacesTreeView(this.flatList, callback);
+
+          // Observer removal is done within the view itself.  When the tree
+          // goes away, treeboxobject calls view.setTree(null), which then
+          // calls removeObserver.
           result.addObserver(treeView, false);
           this.view = treeView;
           if (!this._controller) {
             this._controller = new PlacesController(this);
             this.controllers.appendController(this._controller);
           }
           this._cachedInsertionPoint = undefined;
         ]]></body>