Message-ID: From: "progmachine (@progmachine)" To: "postgresql-interfaces/psqlodbc" Date: Mon, 13 May 2024 18:48:51 +0000 Subject: Re: [postgresql-interfaces/psqlodbc] issue #8: Memory leaks detected in psqlodbc library In-Reply-To: References: List-Id: X-GitHub-Author-Login: progmachine X-GitHub-Comment-Id: 2108568265 X-GitHub-Comment-Type: issue_comment X-GitHub-Edited-At: 2024-05-13T18:50:59Z X-GitHub-Issue: 8 X-GitHub-Repo: postgresql-interfaces/psqlodbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/postgresql-interfaces/psqlodbc/issues/8#issuecomment-2108568265 Content-Type: text/plain; charset=utf-8 That's incorrect. What this function doing, is completely "releasing" COL_INFO objects from ConnectionClass object. No mater if these objects actually destroyed or not, connection object will not have any one of them. So it's just zeroing `self->ntables`, and it is correct. The problem is: - if "destroy" is true (when connection is closing), COL_INFO objects will always be deleted. That's good. - but if "destroy" is false (col_info cache is obsolete), COL_INFO objects will not be deleted, just detached from ConnectionClass object, without correct releasing using refcnt. That's bad :( Today i finally had some spare time to begin working on psqlodbc project, in the near future i will post detailed memory leaks report from tests. And maybe will begin fixing these issues.