Fixing a bug where the cached doxygen docstring could be deleted while still in use, causing swig to segfault
This commit is contained in:
parent
5106573b29
commit
e150d58092
2 changed files with 8 additions and 0 deletions
|
|
@ -1571,6 +1571,11 @@ public:
|
|||
// depends on the comment which is not going to change, so we can
|
||||
// safely cache it.
|
||||
Setattr(n, "python:docstring", Copy(docstr));
|
||||
} else {
|
||||
// Must copy here since if the docstring is multi-line, the String*
|
||||
// here will get Deleted below, which is bad if it is a pointer to
|
||||
// the cached object!
|
||||
docstr = Copy(docstr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue