TechRequirementFactory::~TechRequirementFactory()
	{
		xDelete(_conditionFactory);
		for(auto defFacIt = _defaultFactories.begin(); defFacIt != _defaultFactories.end(); ++defFacIt)
		{
			xDelete(defFacIt->Value);
		}
	}
Example #2
0
	UnitDefinition::~UnitDefinition()
	{
		xDelete(_baseStats);
		for(unsigned int i = 0; i < _trainableUnitsDefs.size(); ++i)
		{
			xDelete( _trainableUnitsDefs[i]->DefinitionName );
			for(unsigned int req = 0; req < _trainableUnitsDefs[i]->RequirementNames.size(); ++req)
			{
				xDelete( _trainableUnitsDefs[i]->RequirementNames[req] );
			}
		}
	}
Example #3
0
	GeneralEventPool::~GeneralEventPool()
	{
		for(auto eIt = _availableEvents.begin(); eIt != _availableEvents.end(); ++eIt)
		{
			xDelete(eIt->second);
		}
	}
Example #4
0
	GeneralFamiliyActionFactory::~GeneralFamiliyActionFactory()
	{
		for(auto facIt = _factories.begin(); facIt != _factories.end(); ++facIt)
		{
			xDelete(facIt->second);
		}
	}
Example #5
0
/*
** Set the auxilary data pointer and delete function, for the iArg'th
** argument to the user-function defined by pCtx. Any previous value is
** deleted by calling the delete function specified when it was set.
*/
void sqlite3_set_auxdata(
  sqlite3_context *pCtx, 
  int iArg, 
  void *pAux, 
  void (*xDelete)(void*)
){
  struct AuxData *pAuxData;
  VdbeFunc *pVdbeFunc;
  if( iArg<0 ) goto failed;

  pVdbeFunc = pCtx->pVdbeFunc;
  if( !pVdbeFunc || pVdbeFunc->nAux<=iArg ){
    int nMalloc = sizeof(VdbeFunc) + sizeof(struct AuxData)*iArg;
    pVdbeFunc = sqliteRealloc(pVdbeFunc, nMalloc);
    if( !pVdbeFunc ) goto failed;
    pCtx->pVdbeFunc = pVdbeFunc;
    memset(&pVdbeFunc->apAux[pVdbeFunc->nAux], 0, 
             sizeof(struct AuxData)*(iArg+1-pVdbeFunc->nAux));
    pVdbeFunc->nAux = iArg+1;
    pVdbeFunc->pFunc = pCtx->pFunc;
  }

  pAuxData = &pVdbeFunc->apAux[iArg];
  if( pAuxData->pAux && pAuxData->xDelete ){
    pAuxData->xDelete(pAuxData->pAux);
  }
  pAuxData->pAux = pAux;
  pAuxData->xDelete = xDelete;
  return;

failed:
  if( xDelete ){
    xDelete(pAux);
  }
}
Example #6
0
	MainEventPool::~MainEventPool()
	{
		RemoveAllTriggers();
		for(auto facIt = _actionParsers.begin(); facIt != _actionParsers.end(); ++facIt)
		{
			xDelete(facIt->second);
		}
		for(auto facIt = _conditionParsers.begin(); facIt != _conditionParsers.end(); ++facIt)
		{
			xDelete(facIt->second);
		}
		for(auto poolIt = _eventPools.begin(); poolIt != _eventPools.end(); ++poolIt)
		{
			xDelete(poolIt->second);
		}
	}
	SceneObjectSelfActionFactory::~SceneObjectSelfActionFactory()
	{
		for(auto facIt = _subFactories.begin(); facIt != _subFactories.end(); ++facIt)
		{
			xDelete(facIt->second);
		}
		_subFactories.clear();
	}
Example #8
0
	void MainEventPool::RemoveAllTriggers()
	{
		// delete all triggers
		for(auto trigIt = _triggers.begin(); trigIt != _triggers.end(); ++trigIt)
		{
			xDelete(trigIt->second);
		}
		_triggers.clear();
	}
Example #9
0
	DllExclusive void FactionHumanPlugin::Deinit()
	{
		for(unsigned int i = 0; i < _pluginInternal->KindDataSups.size(); ++i)
			xDelete(_pluginInternal->KindDataSups[i]);
		for(unsigned int i = 0; i < _pluginInternal->ObjectDataSups.size(); ++i)
			xDelete(_pluginInternal->ObjectDataSups[i]);
		for(unsigned int i = 0; i < _pluginInternal->CommandsSups.size(); ++i)
			xDelete(_pluginInternal->CommandsSups[i]);
		for(unsigned int i = 0; i < _pluginInternal->StatesSups.size(); ++i)
			xDelete(_pluginInternal->StatesSups[i]);
		for(unsigned int i = 0; i < _pluginInternal->ClassSups.size(); ++i)
			xDelete(_pluginInternal->ClassSups[i]);

		_pluginInternal->KindDataSups.clear();
		_pluginInternal->ObjectDataSups.clear();
		_pluginInternal->CommandsSups.clear();
		_pluginInternal->StatesSups.clear();
		_pluginInternal->ClassSups.clear();
	}
Example #10
0
	void MainEventPool::RemoveTrigger(const string& name, bool deleteIt)
	{
		auto trigIt = _triggers.find(name);
		if(trigIt == _triggers.end())
		{
			CastException_d((string("Trigger not registered : ") + name).c_str());
			return;
		}
		Trigger* trigger = trigIt->second;
		_triggers.erase(trigIt);
		if(deleteIt)
			xDelete(trigger);
	}
Example #11
0
	void MainEventPool::RemoveTrigger(Trigger* trigger, bool deleteIt)
	{
		auto trigIt = _triggers.find(trigger->GetName());
		if(trigIt == _triggers.end())
		{
			CastException_d((string("Trigger not registered : ") + trigger->GetName()).c_str());
			return;
		}

		_triggers.erase(trigIt);
		if(deleteIt)
			xDelete(trigger);
	}
Example #12
0
/*
** Set the auxiliary data pointer and delete function, for the iArg'th
** argument to the user-function defined by pCtx. Any previous value is
** deleted by calling the delete function specified when it was set.
*/
void sqlite3_set_auxdata(
  sqlite3_context *pCtx, 
  int iArg, 
  void *pAux, 
  void (*xDelete)(void*)
){
  AuxData *pAuxData;
  Vdbe *pVdbe = pCtx->pVdbe;

  assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
  if( iArg<0 ) goto failed;
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
  if( pVdbe==0 ) goto failed;
#else
  assert( pVdbe!=0 );
#endif

  for(pAuxData=pVdbe->pAuxData; pAuxData; pAuxData=pAuxData->pNext){
    if( pAuxData->iOp==pCtx->iOp && pAuxData->iArg==iArg ) break;
  }
  if( pAuxData==0 ){
    pAuxData = sqlite3DbMallocZero(pVdbe->db, sizeof(AuxData));
    if( !pAuxData ) goto failed;
    pAuxData->iOp = pCtx->iOp;
    pAuxData->iArg = iArg;
    pAuxData->pNext = pVdbe->pAuxData;
    pVdbe->pAuxData = pAuxData;
    if( pCtx->fErrorOrAux==0 ){
      pCtx->isError = 0;
      pCtx->fErrorOrAux = 1;
    }
  }else if( pAuxData->xDelete ){
    pAuxData->xDelete(pAuxData->pAux);
  }

  pAuxData->pAux = pAux;
  pAuxData->xDelete = xDelete;
  return;

failed:
  if( xDelete ){
    xDelete(pAux);
  }
}
/*
** Set the auxilary data pointer and delete function, for the iArg'th
** argument to the user-function defined by pCtx. Any previous value is
** deleted by calling the delete function specified when it was set.
*/
void sqlite4_auxdata_store(
    sqlite4_context *pCtx,
    int iArg,
    void *pAux,
    void (*xDelete)(void*,void*),
    void *pDeleteArg
) {
    struct AuxData *pAuxData;
    VdbeFunc *pVdbeFunc;
    if( iArg<0 ) goto failed;

    assert( sqlite4_mutex_held(pCtx->s.db->mutex) );
    pVdbeFunc = pCtx->pVdbeFunc;
    if( !pVdbeFunc || pVdbeFunc->nAux<=iArg ) {
        int nAux = (pVdbeFunc ? pVdbeFunc->nAux : 0);
        int nMalloc = sizeof(VdbeFunc) + sizeof(struct AuxData)*iArg;
        pVdbeFunc = sqlite4DbRealloc(pCtx->s.db, pVdbeFunc, nMalloc);
        if( !pVdbeFunc ) {
            goto failed;
        }
        pCtx->pVdbeFunc = pVdbeFunc;
        memset(&pVdbeFunc->apAux[nAux], 0, sizeof(struct AuxData)*(iArg+1-nAux));
        pVdbeFunc->nAux = iArg+1;
        pVdbeFunc->pFunc = pCtx->pFunc;
    }

    pAuxData = &pVdbeFunc->apAux[iArg];
    if( pAuxData->pAux && pAuxData->xDelete ) {
        pAuxData->xDelete(pAuxData->pDeleteArg, pAuxData->pAux);
    }
    pAuxData->pAux = pAux;
    pAuxData->xDelete = xDelete;
    pAuxData->pDeleteArg = pDeleteArg;
    return;

failed:
    if( xDelete ) {
        xDelete(pDeleteArg, pAux);
    }
}
Example #14
0
	void FXSoundPool::DestroyCast(FXSound* object)
	{
		_objects.erase(object->GetHandle().Object);
		xDelete(object);
	}
Example #15
0
	extern "C" DllExclusive void EndPlugin(void)
	{
		xDelete(ecoPlugin);
		ecoPlugin = 0;
		Malloc->FreeAllocator(Malloc);
	}
Example #16
0
	FactionOfPlayerRetriever::~FactionOfPlayerRetriever()
	{
		xDelete(_player);
	}
Example #17
0
	DllExclusive FactionHumanPlugin::~FactionHumanPlugin()
	{
		xDelete(_pluginInternal);
	}
Example #18
0
	void ConstructionSiteObjectDataSupplier::DeleteHandle(size_t handle) const
	{
		ConstructionSiteObjectData* data = reinterpret_cast<ConstructionSiteObjectData*>(handle);
		xDelete(data);
	}
Example #19
0
	BoolNotRetriever::~BoolNotRetriever()
	{
		xDelete(_val1);
	}
Example #20
0
	BoolOrRetriever::~BoolOrRetriever()
	{
		xDelete(_val1);
		xDelete(_val2);
	}
Example #21
0
	DllExclusive void FactoryObjectDataSupplier::DeleteHandle(size_t handle) const
	{
		FactoryObjectData* data = reinterpret_cast<FactoryObjectData*>(handle);
		xDelete(data);
	}
Example #22
0
	void FXParticlesPool::DestroyCast(FXParticles* object)
	{
		_objects.erase(object->GetHandle().Object);
		xDelete(object);
	}