Skip to main content
Skip table of contents

(v13) Terminating a timed callback

This page applies to Harlequin v13.1r0 and later; and to Harlequin MultiRIP but not Harlequin Core


When a timed callback is no longer needed, or the application is closing down, a timed callback can be cancelled by calling hqn_timer_destroy () using the timer's handle as returned from hqn_create_timer (). The following example shows how to remove the timer set up in the previous example code:

TEXT
                      void remove_keep_alive_ping(void)
                      {
                        hqn_destroy_timer(keep_alive_timer);
                      }

The call to hqn_destroy_timer () allows any currently running timer callback to run to completion. This allows any resources allocated for the timer callback to be released without synchronization concerns with the callback which may have been running when the timer is removed.

NOTE:  hqn_destroy_timer () should not be called from the callback function.

 

 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.