flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "christofer.dutz@c-ware.de" <christofer.d...@c-ware.de>
Subject AW: RemoteOperation last result not garbage collected
Date Wed, 06 Nov 2013 10:27:33 GMT
Hmmm ... gee ... I really forgott about this :-(

And I have to admit that I have never really used the lastResult of a remote objects function.

How about extending RemoteObject with Parameters to turn this Feature off?


Von: Maurice Amsellem [maurice.amsellem@systar.com]
Gesendet: Mittwoch, 6. November 2013 02:05
An: users@flex.apache.org
Betreff: RemoteOperation last result not garbage collected


I discovered a not-so-known behavior of RemoteObject that could be useful to the community:

RemoteObject RemoteOperations are keeping a reference to the last call result, that can be
retrieved through lastResult property.
Most of the time, you don't need that reference, as you will be processing the result in the
result handlers.

For operations that are called often, and return small result, it's not an issue.
The problem raises if you have a RemoteObject with an operation that is called once (or only
a few times) and returns a large result.
This could be the case for operations that are called at initialization only, and that loads
large results from the server.
In this case, the result of the last (and only) call, will not be garbage collected.

To avoid this, you must clear the result manually in the result handler:.

For example:

protected function handleGenericVOResult(resultEvent:ResultEvent, token:AsyncToken = null):void
    var op: AbstractOperation = _remoteObject.getOperation(RemotingMessage(token.message).operation);

Hope this helps...

View raw message