Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cleanup in OnTermination()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Cleanup in OnTermination()

    Hi Ninja Team,

    I'm using a System.Winodws.Forms.Timer object in a script, and I need to clean up in OnTermination.

    Is this correct?

    protected override void OnTermination()
    {
    myTimer.Dispose();
    }

    Or this?

    protected override void OnTermination()
    {
    base.Dispose();
    myTimer.Dispose();
    }

    Both compile fine... is there a prefered way? Thanks!

    #2
    This is correct.

    protected override void OnTermination()
    {
    myTimer.Dispose();
    }
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    34 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    29 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    36 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    33 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    144 views
    0 likes
    Last Post SalmaTrader  
    Working...
    X