Close() double free bugfix