From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/Winamp/JSAPI_DispatchTable.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Src/Winamp/JSAPI_DispatchTable.cpp (limited to 'Src/Winamp/JSAPI_DispatchTable.cpp') diff --git a/Src/Winamp/JSAPI_DispatchTable.cpp b/Src/Winamp/JSAPI_DispatchTable.cpp new file mode 100644 index 00000000..b8793b4c --- /dev/null +++ b/Src/Winamp/JSAPI_DispatchTable.cpp @@ -0,0 +1,22 @@ +#include "JSAPI_DispatchTable.h" +#include + +JSAPI::Dispatcher::Dispatcher(const wchar_t *_name, DISPID _id, IDispatch *_object) +:id(_id), object(_object) +{ + memset(name, 0, sizeof(name)); + + if (NULL != object) + object->AddRef(); + + StringCchCopyW(name, ARRAYSIZE(name), _name); +} + +JSAPI::Dispatcher::~Dispatcher() +{ + if (NULL != object) + { + object->Release(); + object = NULL; + } +} \ No newline at end of file -- cgit