Update AMTL; replace AutoPtr/UniquePtr with STL.

This commit is contained in:
David Anderson
2020-05-18 18:19:16 -07:00
parent c2df49ee33
commit 7d7253c9cc
20 changed files with 78 additions and 58 deletions
+7 -4
View File
@@ -29,13 +29,16 @@
* Version: $Id$
*/
#include <assert.h>
#include <memory>
#include "ShareSys.h"
#include "ExtensionSys.h"
#include <ILibrarySys.h>
#include "common_logic.h"
#include "PluginSys.h"
#include "HandleSys.h"
#include <assert.h>
using namespace ke;
@@ -406,15 +409,15 @@ AlreadyRefed<Native> ShareSystem::AddFakeNative(IPluginFunction *pFunc, const ch
if (entry)
return nullptr;
AutoPtr<FakeNative> fake(new FakeNative(name, pFunc));
std::unique_ptr<FakeNative> fake(new FakeNative(name, pFunc));
fake->gate = g_pSourcePawn2->CreateFakeNative(func, fake);
fake->gate = g_pSourcePawn2->CreateFakeNative(func, fake.get());
if (!fake->gate)
return nullptr;
CNativeOwner *owner = g_PluginSys.GetPluginByCtx(fake->ctx->GetContext());
entry = new Native(owner, fake.take());
entry = new Native(owner, fake.release());
m_NtvCache.insert(name, entry);
return entry.forget();