Fix formatted_raw_ostream ownership error with the underlying stream.
This commit is contained in:
parent
74982d6fef
commit
a275068193
1 changed files with 7 additions and 1 deletions
|
|
@ -5,5 +5,11 @@ from raw_ostream import raw_ostream
|
||||||
@llvm.Class(raw_ostream)
|
@llvm.Class(raw_ostream)
|
||||||
class formatted_raw_ostream:
|
class formatted_raw_ostream:
|
||||||
_include_ = 'llvm/Support/FormattedStream.h'
|
_include_ = 'llvm/Support/FormattedStream.h'
|
||||||
new = Constructor(ref(raw_ostream), cast(bool, Bool))
|
_new = Constructor(ref(raw_ostream), cast(bool, Bool))
|
||||||
|
|
||||||
|
@CustomPythonStaticMethod
|
||||||
|
def new(stream, destroy=False):
|
||||||
|
inst = formatted_raw_ostream._new(stream, destroy)
|
||||||
|
inst.__underlying_stream = stream # to prevent it being freed first
|
||||||
|
return inst
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue