Skip to content

Add default convention to CallingConvention. #344

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

Merged
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3d0d875
Added default convention to ICallingConvention.
CookStar Aug 5, 2020
fb87d77
Changed constructor to create the default convention from MakeDynamic…
CookStar Aug 14, 2020
f2c403c
Removed "ICallingConventionWrapper *" from the held type.
CookStar Aug 15, 2020
025a421
Fixed removal of setting null.
CookStar Aug 15, 2020
dd295d3
Changed m_pCallingConvention to m_pDefaultCallingConvention.
CookStar Aug 15, 2020
f39a6c4
Simplified CFunction destructor.
CookStar Aug 16, 2020
adbc65a
Fixed a crash introduced by removing "ICallingConventionWrapper *".
CookStar Aug 16, 2020
f3aa765
Removed the convention headers.
CookStar Aug 17, 2020
854d96f
Fixed a crash on unloading Source.Python.
CookStar Aug 24, 2020
f275acc
Fix for VC++ 2010.
CookStar Aug 25, 2020
c47ca12
Fix2 for VC++ 2010.
CookStar Aug 25, 2020
1ae3f1d
Merge branch 'master' into add_default_callingconvention
CookStar Aug 29, 2020
0062175
Added an overload for C-type functions to CFunction::AddHook.
CookStar Sep 1, 2020
3c4935b
Resolved conflicts.
CookStar Sep 29, 2020
8aab63b
Fixed CallingConvention's leaks/issues.
jordanbriere Oct 2, 2020
6b68369
Minor fixes.
jordanbriere Oct 2, 2020
118070b
Merge pull request #2 from jordanbriere/add_default_callingconvention
CookStar Oct 3, 2020
b4cb2c0
Modified CFunction to initialize CallingConvention with default_conve…
CookStar Oct 5, 2020
121a496
Added custom_convention(m_oCallingConvention) attribute to Function.
CookStar Oct 5, 2020
282bf03
Added post-construction initialization support.
jordanbriere Oct 5, 2020
6d26bca
Fixed built-in conventions leaking when they are being unhooked while…
jordanbriere Oct 5, 2020
98d9853
Replaced the post-construction wrapper with stackable policies.
jordanbriere Oct 6, 2020
958cb03
Merge pull request #3 from jordanbriere/add_default_callingconvention
CookStar Oct 6, 2020
f651f57
Fixed namespace issue.
CookStar Oct 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor fixes.
  • Loading branch information
jordanbriere committed Oct 2, 2020
commit 6b683691cccd79ded4dec38c4edd3a2aeab8e698
7 changes: 4 additions & 3 deletions src/core/modules/memory/memory_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ CFunction::~CFunction()
if (m_oCallingConvention.is_none())
delete m_pCallingConvention;
// Otherwise, just release our reference and let Python take care of it.
else
else if (Py_REFCNT(m_oCallingConvention.ptr()) > 1)
Py_DECREF(m_oCallingConvention.ptr());
}

Expand Down Expand Up @@ -427,6 +427,9 @@ void CFunction::DeleteHook()

g_mapCallbacks.erase(pHook);

// Flag the convention as no longer hooked and being taken care of by DynamicHooks.
pHook->m_pCallingConvention->m_bHooked = false;

// Release the Python reference we reserved for DynamicHooks.
ICallingConventionWrapper *pConv = dynamic_cast<ICallingConventionWrapper *>(pHook->m_pCallingConvention);
if (pConv)
Expand All @@ -435,8 +438,6 @@ void CFunction::DeleteHook()
if (pOwner && Py_REFCNT(pOwner))
Py_DECREF(pOwner);
}
// Flag the convention as no longer hooked and being taken care of by DynamicHooks.
pHook->m_pCallingConvention->m_bHooked = false;

// Set the calling convention to NULL, because DynamicHooks will delete it otherwise.
pHook->m_pCallingConvention = NULL;
Expand Down