Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More leaks found #1839

Merged
merged 1 commit into from
Jan 6, 2024
Merged

Conversation

christopherlam
Copy link
Contributor

See commit msg for reasoning

Previous swigged function- note the `new` is never deleted. Because
they are both const char*, they must be swigged similarly to strings.

static SCM
_wrap_QOF_ID_BOOK_SCM ()
{
 #define FUNC_NAME "QOF-ID-BOOK-SCM"
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  QofIdTypeConst result;

  result = QOF_ID_BOOK_SCM();
  {
    QofIdTypeConst * resultptr;
    resultptr = new QofIdTypeConst((const QofIdTypeConst &) result);
    gswig_result =  SWIG_NewPointerObj (resultptr, SWIGTYPE_p_QofIdTypeConst, 1);
  }

  return gswig_result;
 #undef FUNC_NAME
}

After this change:

static SCM
_wrap_QOF_ID_BOOK_SCM ()
{
 #define FUNC_NAME "QOF-ID-BOOK-SCM"
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  QofIdType result;

  result = QOF_ID_BOOK_SCM();
  gswig_result = result ? scm_from_utf8_string (result) : SCM_BOOL_F;

  return gswig_result;
 #undef FUNC_NAME
}
@christopherlam christopherlam marked this pull request as ready for review December 20, 2023 15:42
@code-gnucash-org code-gnucash-org merged commit 2918577 into Gnucash:stable Jan 6, 2024
4 checks passed
@christopherlam christopherlam deleted the stable-leaks branch January 6, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants