bennyxqg / bulk-loader

Automatically exported from code.google.com/p/bulk-loader
0 stars 0 forks source link

[BulkLoader] Cannot use an instance that has been cleared from memory (.clear()) #113

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a class passing a Bulkloader instance in the constructor
2. trace out the loader to ensure it exists, define it a a private variable 
(works)
3. later in the same class try tracing out the Bulkloader instance previously 
defined

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
OSX, FP10

Please provide any additional information below.

What would cause a Bulkloader instance to be cleared from memory?

Original issue reported on code.google.com by bac...@gmail.com on 30 Oct 2009 at 9:35

GoogleCodeExporter commented 9 years ago
Hi Bach44.

If an instance has been cleared, nothing will work. It's not a bug really, but 
a feature.
The clear method is a shortcut to remove everything from it, and therefore it 
must necessarily nullify it.

This is documented on the clear doc :
http://media.stimuli.com.br/projects/bulk-
loader/docs/br/com/stimuli/loading/BulkLoader.html#clear()

Cheers

Original comment by debert on 30 Oct 2009 at 10:05

GoogleCodeExporter commented 9 years ago
Yes I'm familiar with the documentation, yet can think of no reason why I 
shouldn't always be able to retrieve 
a loader instance.

In a component class within an added to stage handler, I am calling
//CODE START
protected var _loader:BulkLoader

//then within the handler
_loader = BulkLoader.getLoader( "imgsLoader" )

//CODE END

This works the first time I reference it in a sub class.

However, later on, when I need to reference the exact same loader, '_loader' is 
null

WTF?

Original comment by bac...@gmail.com on 4 Nov 2009 at 4:13

GoogleCodeExporter commented 9 years ago
Hi Bach.

The missing information here is if you are calling loader.clear().
If you aren't, it's a bug and please let me know so I can fix.

If you are calling clear, why should be able to access the same loader? It's 
not the 
same loader. Once you've called clear, it's lost all of it's events, all of its 
assets, all of 
it's connections. Whatever you were willing to do with that loader instance 
will fail, so 
we nullify the reference to make that easier to grasp.

What I mean is that it should have named the 'clear' method to 
'nukeEverythingAndMakeThisInstanceTotallyUselessForever'

If you wish to remove items from a instance and to keep using that instance, 
then the 
removeAll is the method to call.

Cheers
Arthur

Original comment by debert on 4 Nov 2009 at 5:18