int aw_destroy (void)

DESCRIPTION

Destroys the current bot instance.

CALLBACK

None (returns immediately)

NOTES

aw_destroy destroys the current bot instance, as returned by aw_instance.  In a multi-instance application, call aw_instance_set first to set the instance to be deleted.

aw_destroy immediately deallocates all data structures related to the current instance.  For this reason, it must only be called from your application's main event loop.  Do not call aw_destroy within the context of any event handler or callback.

EXAMPLE

int done;
void handle_chat (void)
{

  /* exit when someone tells us to */
  if (!strcmp (aw_string (AW_CHAT_MESSAGE), "quit")))
    /* note: it would be an error to call aw_destroy() here! */
    done = 1;

}

/* initialization code here... */

/* main event loop */
done = 0;
while (!done)
  aw_wait (1000);
aw_destroy ();

SEE ALSO

aw_create
aw_instance
aw_instance_set