Replace wxNSTimerData -setTimer method with -initWithWxTimer: initializer
authorDavid Elliott <dfe@tgwbd.org>
Tue, 18 Oct 2005 15:27:48 +0000 (15:27 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Tue, 18 Oct 2005 15:27:48 +0000 (15:27 +0000)
commit06c2bab0852eea898770b124bed58f024f9b7cb0
treef062f42ca69edc184718d8e4310bac6d77029a2b
parent159e6235b2bd2c9e991e9380622c9cdc21b0ead6
Replace wxNSTimerData -setTimer method with -initWithWxTimer: initializer
which correctly calls the superclass (NSObject) init.

Add an -init method for correctness; technically not needed as it is never
called but it's an Objective-C best practice.

Release the wxNSTimerData instance just after passing it to the NSTimer
factory method.  NSTimer retains it and we don't keep a pointer to it
so we should not keep a refence to it.  This fixes the bug in wxTimer::Stop
where the program crashes in the NSCFTimer userInfo method because the
NSTimer has already been invalidated.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35941 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
src/cocoa/timer.mm