コード例 #1
0
SerializerLess::~SerializerLess()
{
	if(m_ref)
	{
		DecRef();
	}
}
コード例 #2
0
SocketMgr::~SocketMgr()
{
	ShutdownThreads();

	if (m_hThreads != NULL)
		delete [] m_hThreads;

	DecRef();
}
コード例 #3
0
ファイル: SocketMgr.cpp プロジェクト: Champion2/KOServer
void SocketMgr::Shutdown()
{
	if (m_bShutdown)
		return;

	ShutdownThreads();

	DecRef();
	m_bShutdown = true;
}2
コード例 #4
0
 void CheckDone()
 {
    if (mChannel>=0 && sDoneChannel[mChannel])
    {
       sDoneChannel[mChannel] = false;
       int c = mChannel;
       mChannel = -1;
       DecRef();
       sUsedChannel[c] = 0;
    }
 }
コード例 #5
0
ファイル: DrThread.cpp プロジェクト: Applied-Duality/Dryad
void DrThread::DetachFromCurrentThread()
{
    LogAssert(t_pThread == this);
    t_pThread = NULL;
    DrLogD( "DrThread::AttachToCurrentThread. %s, pThread=%p", m_strClass.GetString(), this);
    m_dwThreadId = 0;
    LogAssert(m_hThread == NULL);
    m_strTag = "INVL";
    m_strDescription = "Unattached Thread";
    DecRef();
    // "this" may no longer exist
}
コード例 #6
0
 void CheckDone()
 {
    if (mPlaying && (sDoneMusic || (sUsedMusic!=this)) )
    {
       mPlaying = false;
       if (sUsedMusic == this)
       {
          sUsedMusic = 0;
          sDoneMusic = false;
       }
       DecRef();
    }
 }
コード例 #7
0
void HawkRefCounter::Release()
{
    //判断引用计数有效,避免无效对象释放
    A_Exception(m_iRef > 0 && "RefCounter Is Error.");

    DecRef();

    //删除对象
    if (m_iRef <= 0)
    {
        delete this;
    }
}
コード例 #8
0
ファイル: SDLSound.cpp プロジェクト: DanielUranga/NME
   void CheckDone()
   {
      if (mPlaying && (sDoneMusic || (sUsedMusic!=this)) )
      {
		 mLength = SDL_GetTicks () - mStartTime;
         mPlaying = false;
         if (sUsedMusic == this)
         {
            sUsedMusic = 0;
            sDoneMusic = false;
         }
         DecRef();
      }
   }
コード例 #9
0
ファイル: scf.cpp プロジェクト: garinh/cs
iBase *scfFactory::CreateInstance ()
{
  IncRef ();
  // If IncRef won't succeed, we'll have a zero reference counter
  if (!scfRefCount)
    return 0;

  iBase *instance = CreateFunc(this);
  csRefTrackerAccess::SetDescriptionWeak (instance, ClassID);

  // No matter whenever we succeeded or not, decrement the refcount
  DecRef ();

  return instance;
}
コード例 #10
0
void OBSBasicStatusBar::StreamStopped()
{
	if (streamOutput) {
		signal_handler_disconnect(
				obs_output_get_signal_handler(streamOutput),
				"reconnect", OBSOutputReconnect, this);
		signal_handler_disconnect(
				obs_output_get_signal_handler(streamOutput),
				"reconnect_success", OBSOutputReconnectSuccess,
				this);

		streamOutput = nullptr;
		clearMessage();
		DecRef();
	}
}
コード例 #11
0
ファイル: LabelDialog.cpp プロジェクト: Avi2011class/audacity
void LabelDialog::OnCancel(wxCommandEvent & WXUNUSED(event))
{
   if (mGrid->IsCellEditControlShown()) {
      auto editor = mGrid->GetCellEditor(mGrid->GetGridCursorRow(),
         mGrid->GetGridCursorCol());
      editor->Reset();
      // To avoid memory leak, don't forget DecRef()!
      editor->DecRef();
      mGrid->HideCellEditControl();
      return;
   }

   // Standard handling
   EndModal(wxID_CANCEL);

   return;
}
コード例 #12
0
gralloc1_error_t BufferManager::ReleaseBuffer(private_handle_t const *hnd) {
  if (hnd->flags & private_handle_t::PRIV_FLAGS_CLIENT_ALLOCATED) {
    return GRALLOC1_ERROR_NONE;
  }
  ALOGD_IF(DEBUG, "Release buffer handle:%p id: %" PRIu64, hnd, hnd->id);
  std::lock_guard<std::mutex> lock(buffer_lock_);
  auto buf = GetBufferFromHandleLocked(hnd);
  if (buf == nullptr) {
    ALOGE("Could not find handle: %p id: %" PRIu64, hnd, hnd->id);
    return GRALLOC1_ERROR_BAD_HANDLE;
  } else {
    if (buf->DecRef()) {
      handles_map_.erase(hnd);
      // Unmap, close ion handle and close fd
      FreeBuffer(buf);
    }
  }
  return GRALLOC1_ERROR_NONE;
}
コード例 #13
0
ファイル: Tags.cpp プロジェクト: SteveDaulton/audacity
void TagsEditor::DoCancel(bool escKey)
{
   if (mGrid->IsCellEditControlShown()) {
      auto editor = mGrid->GetCellEditor(mGrid->GetGridCursorRow(),
         mGrid->GetGridCursorCol());
      editor->Reset();
      // To avoid memory leak, don't forget DecRef()!
      editor->DecRef();
      mGrid->HideCellEditControl();
#if defined(__WXMSW__)
      return;
#endif
   }

   auto focus = wxWindow::FindFocus();
   if (escKey && focus == mGrid)
      return;

   EndModal(wxID_CANCEL);
}
コード例 #14
0
ファイル: Tags.cpp プロジェクト: SteveDaulton/audacity
void TagsEditor::PopulateGenres()
{
   int cnt = mLocal.GetNumUserGenres();
   int i;
   wxString parm;
   wxArrayString g;

   for (i = 0; i < cnt; i++) {
      g.push_back(mLocal.GetUserGenre(i));
   }
   std::sort( g.begin(), g.end() );

   for (i = 0; i < cnt; i++) {
      parm = parm + (i == 0 ? wxT("") : wxT(",")) + g[i];
   }

   // Here was a memory leak!  wxWidgets docs for wxGrid::GetDefaultEditorForType() say:
   // "The caller must call DecRef() on the returned pointer."
   auto editor = mGrid->GetDefaultEditorForType(wxT("Combo"));
   editor->SetParameters(parm);
   editor->DecRef();
}
コード例 #15
0
ファイル: GameMasterCommands.cpp プロジェクト: armm77/AscEmu
//.gm blockwhispers
bool ChatHandler::HandleGMBlockWhispersCommand(const char* args, WorldSession* m_session)
{
    if (args == 0)
    {
        RedSystemMessage(m_session, "No playername set.");
        RedSystemMessage(m_session, "Use .gm blockwhispers <playername>");
        return true;
    }

    auto player_cache = objmgr.GetPlayerCache(args, false);
    if (player_cache == nullptr)
    {
        RedSystemMessage(m_session, "Player %s not found.", args);
        return true;
    }

    m_session->GetPlayer()->m_cache->RemoveValue64(CACHE_GM_TARGETS, player_cache->GetUInt32Value(CACHE_PLAYER_LOWGUID));
    std::string name;
    player_cache->GetStringValue(CACHE_PLAYER_NAME, name);
    BlueSystemMessage(m_session, "Now blocking whispers from %s.", name.c_str());
    player_cache->DecRef();

    return true;
}
コード例 #16
0
ファイル: jansson_handle.hpp プロジェクト: morsya/omim
 ~JsonHandle()
 {
   DecRef();
 }
コード例 #17
0
void OBSBasicStatusBar::RecordingStopped()
{
	recordOutput = nullptr;
	DecRef();
}
コード例 #18
0
ファイル: jansson_handle.hpp プロジェクト: morsya/omim
  /// Attach newly created object without incrementing ref count (it's already == 1).
  void AttachNew(json_struct_t * pJson)
  {
    DecRef();

    m_pJson = pJson;
  }