//--------------------------------------------------------------------------------------------------
        //--------------------------------------------------------------------------------------------------
        void HttpRequestSystem::OnDestroy()
        {
            CancelAllRequests();

            for(auto it = m_requests.begin(); it != m_requests.end(); ++it)
            {
                CS_SAFEDELETE(*it);
            }

            m_requests.clear();
            m_requests.shrink_to_fit();

            m_javaSystem.reset();
        }
		//--------------------------------------------------------------------------------------------------
		//--------------------------------------------------------------------------------------------------
		void HttpRequestSystem::OnUpdate(f32 in_timeSinceLastUpdate)
		{
            for(auto it = m_requests.begin(); it != m_requests.end(); /*No increment*/)
            {
                if((*it)->HasCompleted())
                {
                    CS_SAFEDELETE(*it);
                    it = m_requests.erase(it);
                }
                else
                {
                    ++it;
                }
			}
		}
		//--------------------------------------------------------------------------------------------------
		//--------------------------------------------------------------------------------------------------
		void HttpRequestSystem::OnDestroy()
		{
			CancelAllRequests();

			HttpRequest::Shutdown();

			for (auto it = m_requests.begin(); it != m_requests.end(); ++it)
			{
				CS_SAFEDELETE(*it);
			}

			m_requests.clear();
			m_requests.shrink_to_fit();

			WinHttpCloseHandle(m_sessionHandle);
		}
		//--------------------------------------------------------------------------------------------------
		//--------------------------------------------------------------------------------------------------
		void HttpRequestSystem::OnUpdate(f32 in_timeSinceLastUpdate)
		{
			//We should do this in two loops incase anyone tries to insert into the requests from the completion callback
			for (u32 i=0; i<m_requests.size(); ++i)
			{
				m_requests[i]->Update(in_timeSinceLastUpdate);
			}

			for (auto it = m_requests.begin(); it != m_requests.end(); /*No increment*/)
			{
				if((*it)->HasCompleted())
				{
					//...and remove the completed request
					CS_SAFEDELETE(*it);
					it = m_requests.erase(it);
				}
				else
				{
					++it;
				}
			}
		}
		//--------------------------------------------------------------------------------------
		//--------------------------------------------------------------------------------------
		void CoreJavaInterface::DestroyApplication()
		{
			m_application->Destroy();
			CS_SAFEDELETE(m_application);
		}
Beispiel #6
0
		//-----------------------------------------------------------------
		/// Destructor
		//-----------------------------------------------------------------
		SubMesh::~SubMesh()
		{
			CS_SAFEDELETE(mpMeshBuffer);
		}
Beispiel #7
0
		//------------------------------------------------------
		/// Destructor
		///
		//------------------------------------------------------
		SpriteBatch::~SpriteBatch() 
		{
			CS_SAFEDELETE(mpSpriteBuffer);
		}