mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-06 18:08:36 +00:00
PR review changes
This commit is contained in:
parent
9a4aa49209
commit
0949fc92a8
@ -44,9 +44,10 @@ MemoryPointer::MemoryPointer(void* ptr, cell_t size) : m_ptr(ptr), m_owned(false
|
||||
|
||||
MemoryPointer::~MemoryPointer()
|
||||
{
|
||||
if (m_owned)
|
||||
if (m_owned && m_ptr)
|
||||
{
|
||||
free(m_ptr);
|
||||
m_ptr = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -214,7 +214,7 @@ static cell_t smn_GameConfGetAddressEx(IPluginContext *pCtx, const cell_t *param
|
||||
}
|
||||
|
||||
char *key;
|
||||
void* val;
|
||||
void* val = nullptr;
|
||||
pCtx->LocalToString(params[2], &key);
|
||||
|
||||
if (!gc->GetAddress(key, &val) || val == nullptr)
|
||||
@ -248,7 +248,7 @@ static cell_t smn_GameConfGetMemSigEx(IPluginContext *pCtx, const cell_t *params
|
||||
}
|
||||
|
||||
char *key;
|
||||
void *val;
|
||||
void *val = nullptr;
|
||||
pCtx->LocalToString(params[2], &key);
|
||||
|
||||
if (!gc->GetMemSig(key, &val) || val == nullptr)
|
||||
|
||||
@ -121,7 +121,7 @@ methodmap GameData < Handle
|
||||
//
|
||||
// @param name Name of the property to find.
|
||||
// @return New MemoryPointer handle containing the address calculated on success, or null on failure.
|
||||
public native Address GetAddressEx(const char[] name);
|
||||
public native MemoryPointer GetAddressEx(const char[] name);
|
||||
|
||||
// Returns a function address calculated from a signature.
|
||||
//
|
||||
@ -134,7 +134,7 @@ methodmap GameData < Handle
|
||||
//
|
||||
// @param name Name of the property to find.
|
||||
// @return New MemoryPointer handle containing the address calculated on success, or null on failure.
|
||||
public native Address GetMemSigEx(const char[] name);
|
||||
public native MemoryPointer GetMemSigEx(const char[] name);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user