On 19 October 2011 20:41, Russell Nelson <[email protected]> wrote:
> In order to support viewing deleted files (currently a blocker bug in > SwiftMedia), I'm going to refactor File::getPath() into a new public > function File::getLocalPath(), which will return an instance of a new > class TempLocalPath, which will have two methods: getPath(), and > close(). This class will own a local copy of the file. When it goes > out of scope or its close() method is called (same thing), any > resources held by the class will be freed. > > With the upcoming FileBackend class and subclasses, this class will be > a requirement. Since I need it anyway, I may as well do the work now > to create it. File::getPath() will remain as a call, but it will throw > an exception if SwiftMedia is installed. When I get finished, its only > uses will be by extension writers who have chosen not to publish their > code in our SVN. > Is there a more standardised name than "close"? "dispose" is pretty common in compiled languages; do we have any sort of standard for that behaviour within MW? If not, is this a good opportunity to create one? Other than that it sounds like a good plan to me. --HM _______________________________________________ Wikitech-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikitech-l
