Skip to content

mod.dronescan: OnDetach stops cancelling timers after the first failure #97

Description

@MrIron-no

mod.dronescan/dronescan.cc:1118-1120:

if (!MyUplink->UnRegisterTimer(tidClearJoinCounter, 0) ||
    !MyUplink->UnRegisterTimer(tidClearNickCounter, 0) ||
    !MyUplink->UnRegisterTimer(tidClearActiveList, 0)) {

|| short-circuits, so if the first call returns false the second and third are never made. That means on exactly the path which then logs "Could not unregister timer. Expect problems shortly.", two of the three timers are left registered.

It is masked in practice: xServer::unregisterClient() calls removeAllTimers() for the client, which sweeps whatever the module missed. But the code does not do what it reads as doing, and the log line reports a problem while quietly making it larger.

Fix: perform all three cancellations unconditionally and combine the results, rather than relying on a short-circuiting condition for the side effects.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions