Fixing a bug where the cached doxygen docstring could be deleted while still in use, causing swig to segfault

This commit is contained in:
Alec Woods 2019-01-25 20:07:57 -05:00
commit e150d58092
2 changed files with 8 additions and 0 deletions

View file

@ -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);
}
}
}