mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 12:00:56 +01:00
C++ API changes+fixes:
- context is now a pointer to make sure there's only one all the time - fixed a couple of double free's - some minor bug fixes
This commit is contained in:
@@ -26,9 +26,22 @@ using namespace pcp;
|
||||
|
||||
PcpContext::PcpContext() {
|
||||
ptx = ptx_new();
|
||||
iscopy = false;
|
||||
}
|
||||
|
||||
void PcpContext::done() {
|
||||
ptx_clean(ptx);
|
||||
PcpContext::~PcpContext() {
|
||||
if(!iscopy) {
|
||||
ptx_clean(ptx);
|
||||
}
|
||||
}
|
||||
|
||||
PcpContext& PcpContext::operator = (const PcpContext *PTX) {
|
||||
ptx = PTX->ptx;
|
||||
iscopy = 1;
|
||||
return *this;
|
||||
}
|
||||
|
||||
PcpContext::PcpContext(const PcpContext *PTX) {
|
||||
ptx = PTX->ptx;
|
||||
iscopy = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user