diff --git a/client/src/include/lib3270/ipc.h b/client/src/include/lib3270/ipc.h index 9f18180..5d45ad8 100644 --- a/client/src/include/lib3270/ipc.h +++ b/client/src/include/lib3270/ipc.h @@ -113,16 +113,16 @@ * */ template - class lib3270_auto_cleanup { + class lib3270_ptr { private: T *data; public: - lib3270_auto_cleanup(T *data) { + lib3270_ptr(T *data) { this->data = data; } - ~lib3270_auto_cleanup() { + ~lib3270_ptr() { lib3270_free((void *) this->data); } diff --git a/client/src/session/local/get.cc b/client/src/session/local/get.cc index 33d1dc4..6f3883c 100644 --- a/client/src/session/local/get.cc +++ b/client/src/session/local/get.cc @@ -46,7 +46,7 @@ std::lock_guard lock(const_cast(this)->sync); - lib3270_auto_cleanup text = lib3270_get_string_at_address(hSession, 0, -1, '\n'); + lib3270_ptr text = lib3270_get_string_at_address(hSession, 0, -1, '\n'); if(!text) { throw std::runtime_error( _("Can't get screen contents") ); @@ -59,7 +59,7 @@ std::lock_guard lock(const_cast(this)->sync); - lib3270_auto_cleanup text = lib3270_get_string_at_address(hSession, baddr, len, lf); + lib3270_ptr text = lib3270_get_string_at_address(hSession, baddr, len, lf); if(!text) { throw std::runtime_error( _("Can't get screen contents") ); @@ -72,7 +72,7 @@ std::lock_guard lock(const_cast(this)->sync); - lib3270_auto_cleanup text = lib3270_get_string_at(hSession, row, col, len, lf); + lib3270_ptr text = lib3270_get_string_at(hSession, row, col, len, lf); if(!text) { throw std::runtime_error( _("Can't get screen contents") ); -- libgit2 0.21.2