mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
@@ -17,34 +17,6 @@ namespace BlackSimPlugin
|
||||
{
|
||||
namespace Fs9
|
||||
{
|
||||
//! Safely release a COM allocated object
|
||||
template <class T>
|
||||
void SafeRelease(T*& pT)
|
||||
{
|
||||
if (pT)
|
||||
pT->Release();
|
||||
pT = nullptr;
|
||||
}
|
||||
|
||||
//! Safely delete an allocated pointer
|
||||
template <class T>
|
||||
void SafeDelete(T*& pT)
|
||||
{
|
||||
if( pT != nullptr )
|
||||
delete pT;
|
||||
pT = nullptr;
|
||||
}
|
||||
|
||||
//! Safely delete an allocated array
|
||||
template <class T>
|
||||
void SafeDeleteArray(T*& pT)
|
||||
{
|
||||
if(pT)
|
||||
delete[] pT;
|
||||
pT = nullptr;
|
||||
}
|
||||
|
||||
|
||||
//! Print the direct play error
|
||||
HRESULT logDirectPlayError(HRESULT error);
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "directplaypeer.h"
|
||||
#include "directplayutils.h"
|
||||
#include "multiplayerpacketparser.h"
|
||||
#include "blacksimpluginfreefunctions.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
45
src/plugins/simulator/fs9/directplayutils.h
Normal file
45
src/plugins/simulator/fs9/directplayutils.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* Copyright (C) 2016
|
||||
* swift project community / contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSIMPLUGIN_FS9_DIRECTPLAYUTILS_H
|
||||
#define BLACKSIMPLUGIN_FS9_DIRECTPLAYUTILS_H
|
||||
|
||||
namespace BlackSimPlugin
|
||||
{
|
||||
namespace Fs9
|
||||
{
|
||||
//! Safely release a COM allocated object
|
||||
template <class T>
|
||||
void SafeRelease(T*& pT)
|
||||
{
|
||||
if (pT) { pT->Release(); }
|
||||
pT = nullptr;
|
||||
}
|
||||
|
||||
//! Safely delete an allocated pointer
|
||||
template <class T>
|
||||
void SafeDelete(T*& pT)
|
||||
{
|
||||
delete pT;
|
||||
pT = nullptr;
|
||||
}
|
||||
|
||||
//! Safely delete an allocated array
|
||||
template <class T>
|
||||
void SafeDeleteArray(T*& pT)
|
||||
{
|
||||
delete[] pT;
|
||||
pT = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "multiplayerpackets.h"
|
||||
#include "multiplayerpacketparser.h"
|
||||
#include "blacksimpluginfreefunctions.h"
|
||||
#include "directplayutils.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/geo/coordinategeodetic.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
|
||||
#include "blacksimpluginfreefunctions.h"
|
||||
#include "directplayutils.h"
|
||||
#include "fs9host.h"
|
||||
#include "multiplayerpacketparser.h"
|
||||
#include "multiplayerpackets.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
|
||||
#include "blacksimpluginfreefunctions.h"
|
||||
#include "directplayutils.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "fs9.h"
|
||||
#include "lobbyclient.h"
|
||||
|
||||
Reference in New Issue
Block a user