diff --git a/thorlcr/thorutil/thbuf.cpp b/thorlcr/thorutil/thbuf.cpp index d47124262d6..5472c3b7470 100644 --- a/thorlcr/thorutil/thbuf.cpp +++ b/thorlcr/thorutil/thbuf.cpp @@ -607,7 +607,8 @@ class CSmartRowInMemoryBuffer: public CSimpleInterface, implements ISmartRowBuff ISmartRowBuffer * createSmartBuffer(CActivityBase *activity, const char * tempname, size32_t buffsize, IThorRowInterfaces *rowif) { - return new CSmartRowBuffer(activity,createIFile(tempname),buffsize,rowif); + Owned file = createIFile(tempname); + return new CSmartRowBuffer(activity,file,buffsize,rowif); } ISmartRowBuffer * createSmartInMemoryBuffer(CActivityBase *activity, IThorRowInterfaces *rowIf, size32_t buffsize)