[xiph-commits] r8677 - trunk/oggdsf/src/lib/core/directshow/dsfOggMux

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Sat Jan 8 09:14:46 PST 2005


Author: illiminable
Date: 2005-01-08 09:14:45 -0800 (Sat, 08 Jan 2005)
New Revision: 8677

Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp
Log:
* Kill circular reference cause COM leak.
* Kill some other leaks.

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp	2005-01-08 15:50:14 UTC (rev 8676)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp	2005-01-08 17:14:45 UTC (rev 8677)
@@ -129,9 +129,14 @@
 	mInputPins.push_back(new OggMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
 	debugLog.open("g:\\logs\\muxer.log", ios_base::out);
 
-	//Make our delegate pin[0], the top pin... we send all out requests there.
-	IMediaSeeking* locSeeker = NULL;
-	mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+	////Make our delegate pin[0], the top pin... we send all out requests there.
+	//IMediaSeeking* locSeeker = NULL;
+	//mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+	//SetDelegate(locSeeker);
+
+	//To avoid a circular reference... we do this without the addref.
+	// This is safe because we control the lifetime of this pin, and it won't be deleted until we are.
+	IMediaSeeking* locSeeker = (IMediaSeeking*)mInputPins[0];
 	SetDelegate(locSeeker);
 	
 }
@@ -155,6 +160,9 @@
 	//IMediaSeeking* locSeeker = NULL;
 	//mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
 	//SetDelegate(locSeeker);
+
+
+
 	
 }
 
@@ -162,6 +170,15 @@
 {
 	//debugLog.close();
 	//DbgLog((LOG_ERROR, 1, TEXT("****************** DESTRUCTOR **********************")));
+
+	//ReleaseDelegate();
+	
+	delete mInterleaver;
+	for (size_t i = 0; i < mInputPins.size(); i++) {
+		delete mInputPins[i];
+	}
+
+
 	delete m_pLock;
 	delete mStreamLock;
 	

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp	2005-01-08 15:50:14 UTC (rev 8676)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp	2005-01-08 17:14:45 UTC (rev 8677)
@@ -291,6 +291,7 @@
 	inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
 	SetDelegate(locSeeker);
 	
+	
 	mMuxStream->setIsActive(true);
 	return mParentFilter->addAnotherPin();
 



More information about the commits mailing list