This effectively runs when the owning object gets garbage collected, right? Suggestion: add a Close() API that frees the resources early. The object that ssl_ points to is something that probably should be freed as soon as possible.