Skip to content

Commit

Permalink
Make it call LwM2mObjectEnabler#stop() on LeshanClient#destroy()
Browse files Browse the repository at this point in the history
If an instance of `LwM2mObjectEnabler` doesn't implement the
`Destroyable` but that implements `Stoppable` instead,
it calls `#stop()` on `LeshanClient#destroy()` instead of `destroy()`.

Signed-off-by: moznion <[email protected]>
  • Loading branch information
moznion committed Nov 27, 2020
1 parent bd7f86d commit c334876
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ public void destroy(boolean deregister) {
for (LwM2mObjectEnabler objectEnabler : objectTree.getObjectEnablers().values()) {
if (objectEnabler instanceof Destroyable) {
((Destroyable) objectEnabler).destroy();
} else if (objectEnabler instanceof Stoppable) {
((Stoppable) objectEnabler).stop();
}
}

Expand Down

0 comments on commit c334876

Please sign in to comment.