[the-board] [model] Discard cancellable before finishing page content load



commit afc2b218e6b1b035435bd683b48a68da0e53f5d2
Author: Lucas Rocha <lucasr gnome org>
Date:   Tue Apr 12 22:55:12 2011 +0100

    [model] Discard cancellable before finishing page content load
    
    So that we don't end up with a dangling reference to the cancellable in
    case of a JS exception.

 src/js/model/pageModel.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/js/model/pageModel.js b/src/js/model/pageModel.js
index d3bdeeb..a371cfa 100644
--- a/src/js/model/pageModel.js
+++ b/src/js/model/pageModel.js
@@ -145,6 +145,9 @@ PageModel.prototype = {
     _onLoadContentsAsync : function(file, result, data) {
         log('PageModel: file.load_contents_finish()');
 
+        // discard cancellable
+        delete this._contentLoadingCancellable;
+
         let content = "";
 
         try {
@@ -155,9 +158,6 @@ PageModel.prototype = {
             return;
         }
 
-        // discard cancellable
-        delete this._contentLoadingCancellable;
-
         try {
             let newContent = JSON.JSON.parse(content);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]