Skip to content

Commit

Permalink
To avoid potentially memory leak. And avoid use ZeroMemory of this po…
Browse files Browse the repository at this point in the history
…inter.
  • Loading branch information
intorr committed Dec 9, 2017
1 parent f77a2e2 commit 3761287
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Layers/xrRenderDX10/3DFluid/dx103DFluidData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,14 @@ void dx103DFluidData::ParseProfile(const xr_string& Profile)

u32 iEmittersNum = ini.r_u32("volume", "EmittersNum");

m_Emitters.clear();
m_Emitters.resize(iEmittersNum);

for (u32 i = 0; i < iEmittersNum; ++i)
{
string32 EmitterSectionName;
CEmitter& Emitter = m_Emitters[i];
ZeroMemory(&Emitter, sizeof(Emitter));

xr_sprintf(EmitterSectionName, "emitter%02d", i);

Emitter.m_eType = (dx103DFluidEmitters::EmitterType)ini.r_token(EmitterSectionName, "Type", emitter_type_token);
Expand Down
8 changes: 6 additions & 2 deletions src/xrCore/Animation/Bone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,15 @@ enum EBoneCallbackType

IC void CBoneInstance::construct()
{
ZeroMemory(this, sizeof(*this));
mTransform.identity();

mRenderTransform.identity();

Callback = NULL;
Callback_Param = NULL;
Callback_overwrite = FALSE;
Callback_type = 0;

ZeroMemory(&param, sizeof(param));
}

#endif
18 changes: 17 additions & 1 deletion src/xrEngine/tntQAVI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,25 @@

CAviPlayerCustom::CAviPlayerCustom()
{
ZeroMemory(this, sizeof(*this));
alpha = NULL;

m_pMovieIndex = NULL;
m_pMovieData = NULL;
m_aviIC = NULL;
m_pDecompressedBuf = NULL;

ZeroMemory(&m_biOutFormat, sizeof(BITMAPINFOHEADER));
ZeroMemory(&m_biInFormat, sizeof(BITMAPINFOHEADER));

m_fRate = 0.0f;
m_fCurrentRate = 0.0f;

m_dwFrameTotal = 0;
m_dwFrameCurrent = 0xfffffffd; // страхуемся от 0xffffffff + 1 == 0
m_dwFirstFrameOffset = 0;

m_dwWidth = 0;
m_dwHeight = 0;
}

CAviPlayerCustom::~CAviPlayerCustom()
Expand Down

0 comments on commit 3761287

Please sign in to comment.