Changeset 92

Show
Ignore:
Timestamp:
11/19/08 07:23:43 (4 years ago)
Author:
kluck
Message:

Fix for a very weird bug where the CS3 debugger calls all getters on all items before the constructor fires. See mailing list thread:

 http://osflash.org/pipermail/flashr_osflash.org/2008-November/000612.html

Location:
trunk/com/kelvinluck/flashr/core
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/com/kelvinluck/flashr/core/Flashr.as

    r88 r92  
    332332        function get cache():FlashrCache 
    333333        { 
    334                 return FlashrCache.getInstance(); 
    335         } 
     334                return _cache; 
     335        } 
     336 
    336337        function set cache(cache:FlashrCache):Void {} 
    337338        private var _cache:FlashrCache; 
     
    343344        function get queue():FlashrRequestQueue 
    344345        { 
    345                 return FlashrRequestQueue.getInstance(); 
     346                return _queue; 
    346347        } 
    347348        function set queue(q:FlashrRequestQueue):Void {} 
     349        private var _queue:FlashrRequestQueue; 
    348350         
    349351        /** 
     
    378380        function get history():FlashrResponseHistory 
    379381        { 
    380                 return FlashrResponseHistory.getInstance(); 
     382                return _history; 
    381383        } 
    382384        function set history(frh:FlashrResponseHistory) {} 
     385        private var _history:FlashrResponseHistory; 
    383386         
    384387        /** 
     
    401404        { 
    402405                LogWrapper.getLog().debug(this+" created"); 
     406                _cache = FlashrCache.getInstance(); 
     407                _queue = FlashrRequestQueue.getInstance(); 
     408                _history = FlashrResponseHistory.getInstance(); 
    403409                awaitingResponse = false; 
    404410                EventDispatcher.initialize(this); 
  • trunk/com/kelvinluck/flashr/core/FlashrRequest.as

    r82 r92  
    9494        { 
    9595                if (__querystring == undefined) { 
    96                         __querystring = _prepareQuerystring(); 
     96                        // to fix a dodgy bug in the CS3 debugger where the getter is called before the constructor when debugging!! 
     97                        if (method) { 
     98                                __querystring = _prepareQuerystring(); 
     99                        } 
    97100                } 
    98101                return __querystring; 
  • trunk/com/kelvinluck/flashr/core/FlashrRequestQueue.as

    r82 r92  
    5353        private function FlashrRequestQueue() 
    5454        { 
     55                LogWrapper.getLog().debug(this+" created"); 
    5556                _priorityQueue = new PriorityQueue(); 
    5657        } 
  • trunk/com/kelvinluck/flashr/core/FlashrResponseHistory.as

    r79 r92  
     1import com.kelvinluck.util.LogWrapper; 
    12import com.kelvinluck.flashr.core.FlashrResponseEvent; 
    23/** 
     
    5556        private function FlashrResponseHistory() 
    5657        { 
     58                LogWrapper.getLog().debug(this+" created"); 
    5759                _history = []; 
    5860        }