[SCM] kodi-pvr-vdr-vnsi/master: VNSIData: automatic CEvent allocation

tiber-guest at users.alioth.debian.org tiber-guest at users.alioth.debian.org
Sun Feb 28 15:46:51 UTC 2016


The following commit has been merged in the master branch:
commit e840ab1867372b8b0767fafc5ea3688344f0b6ce
Author: Max Kellermann <max at duempel.org>
Date:   Sat Nov 21 23:51:41 2015 +0100

    VNSIData: automatic CEvent allocation

diff --git a/src/VNSIData.cpp b/src/VNSIData.cpp
index c8cb18d..67f15c7 100644
--- a/src/VNSIData.cpp
+++ b/src/VNSIData.cpp
@@ -88,7 +88,6 @@ std::unique_ptr<cResponsePacket> cVNSIData::ReadResult(cRequestPacket* vrp)
   m_mutex.Lock();
 
   SMessage &message(m_queue[vrp->getSerial()]);
-  message.event = new CEvent;
 
   m_mutex.Unlock();
 
@@ -99,7 +98,7 @@ std::unique_ptr<cResponsePacket> cVNSIData::ReadResult(cRequestPacket* vrp)
     return NULL;
   }
 
-  if (!message.event->Wait(g_iConnectTimeout * 1000))
+  if (!message.event.Wait(g_iConnectTimeout * 1000))
   {
     XBMC->Log(LOG_ERROR, "%s - request timed out after %d seconds", __FUNCTION__, g_iConnectTimeout);
   }
@@ -107,7 +106,6 @@ std::unique_ptr<cResponsePacket> cVNSIData::ReadResult(cRequestPacket* vrp)
   m_mutex.Lock();
 
   auto vresp = std::move(message.pkt);
-  delete message.event;
 
   m_queue.erase(vrp->getSerial());
 
@@ -878,7 +876,7 @@ void *cVNSIData::Process()
       if (it != m_queue.end())
       {
         it->second.pkt = std::move(vresp);
-        it->second.event->Broadcast();
+        it->second.event.Broadcast();
       }
     }
 
diff --git a/src/VNSIData.h b/src/VNSIData.h
index 3aa91bc..7f4ffe8 100644
--- a/src/VNSIData.h
+++ b/src/VNSIData.h
@@ -85,7 +85,7 @@ private:
 
   struct SMessage
   {
-    PLATFORM::CEvent *event;
+    PLATFORM::CEvent event;
     std::unique_ptr<cResponsePacket> pkt;
   };
   typedef std::map<int, SMessage> SMessages;

-- 
kodi-pvr-vdr-vnsi packaging



More information about the pkg-multimedia-commits mailing list