From 908b63fccd82409c1d40f621cdc6a3d1399bd65d Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 8 Jan 2014 17:10:29 +0000 Subject: [PATCH] [Cython] Fix compilation issue when using Clang --- interfaces/cython/cantera/_cantera.pxd | 2 +- interfaces/cython/cantera/reactionpath.pyx | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/interfaces/cython/cantera/_cantera.pxd b/interfaces/cython/cantera/_cantera.pxd index 975ec753a..a9ed8c177 100644 --- a/interfaces/cython/cantera/_cantera.pxd +++ b/interfaces/cython/cantera/_cantera.pxd @@ -724,7 +724,7 @@ cdef class ReactionPathDiagram: cdef Kinetics kinetics cdef str element cdef pybool built - cdef CxxStringStream _log + cdef CxxStringStream* _log # free functions cdef string stringify(x) diff --git a/interfaces/cython/cantera/reactionpath.pyx b/interfaces/cython/cantera/reactionpath.pyx index 0ec119731..dfb2f43e1 100644 --- a/interfaces/cython/cantera/reactionpath.pyx +++ b/interfaces/cython/cantera/reactionpath.pyx @@ -1,4 +1,10 @@ cdef class ReactionPathDiagram: + def __cinit__(self, *args, **kwargs): + self._log = new CxxStringStream() + + def __dealloc__(self): + del self._log + def __init__(self, Kinetics kin, str element): """ Create a reaction path diagram for the fluxes of the element *element* @@ -6,7 +12,7 @@ cdef class ReactionPathDiagram: *kin*. """ self.kinetics = kin - self.builder.init(self._log, deref(kin.kinetics)) + self.builder.init(deref(self._log), deref(kin.kinetics)) self.element = element self.built = False @@ -163,7 +169,7 @@ cdef class ReactionPathDiagram: return representations of the diagram, e.g. write_dot(). """ self.builder.build(deref(self.kinetics.kinetics), - stringify(self.element), self._log, + stringify(self.element), deref(self._log), self.diagram, True) self.built = True if verbose: