It's true.  I would prefer an interface that exposes the cleanup handler and gives you an argument to optionally register it at open.  That's just my opinion, though.