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:
@@ -48,11 +48,17 @@ Buf::Buf(string name, size_t blocksize) {
|
||||
}
|
||||
|
||||
Buf::~Buf() {
|
||||
buffer_free(B);
|
||||
if(B != NULL) {
|
||||
buffer_free(B);
|
||||
B = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Buf& Buf::operator = (const Buf &b) {
|
||||
B = b.B;
|
||||
char *name = (char *)ucmalloc(20);
|
||||
sprintf(name, "copy of %s", b.B->name);
|
||||
B = buffer_new(32, name);
|
||||
buffer_add_buf(B, b.B);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user