From e13616b5c40f912853be99f0603f0e4c97b22062 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 3 Apr 2019 21:56:51 +0800 Subject: *misc --- source/modules/asura-utils/io/file_data.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/modules/asura-utils/io/file_data.cpp') diff --git a/source/modules/asura-utils/io/file_data.cpp b/source/modules/asura-utils/io/file_data.cpp index 92333cf..ad58db9 100644 --- a/source/modules/asura-utils/io/file_data.cpp +++ b/source/modules/asura-utils/io/file_data.cpp @@ -21,6 +21,8 @@ namespace AsuraEngine FileData::~FileData() { + if (mData) + mData->Release(); } const std::string& FileData::GetFileName() @@ -40,7 +42,12 @@ namespace AsuraEngine void FileData::BindData(ASURA_MOVE DataBuffer* buffer) { + if (!buffer) + return; + if (mData) + mData->Release(); mData = buffer; + mData->Retain(); } DataBuffer* FileData::GetDataBuffer() @@ -49,4 +56,4 @@ namespace AsuraEngine } } -} +} \ No newline at end of file -- cgit v1.1-26-g67d0