<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/9400" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2013-09-08T17:06:39+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/9400</id>

		<entry>
		<author><name><![CDATA[Sinsemilla]]></name></author>
		<updated>2013-09-08T17:06:39+00:00</updated>

		<published>2013-09-08T17:06:39+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=31681#p31681</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=31681#p31681"/>
		<title type="html"><![CDATA[Possible fixes for Memory leaks in BulletMultiThreaded]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=31681#p31681"><![CDATA[
Hi,<br><br><br>First of all, i want to say that bullet is a great Library in my opinion, you guys are doing a really great job.  <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br><br>Unfortunately i had crashes with my application when i was implementing the multiple threads as shown in the App_MultiThreadedDemo. Because of this, i changed a few things in the BulletMultiThreaded library, which i want to give back. <br><br> - In btParallelConstraintSolver::~btParallelConstraintSolver(), at line 1159, i changed <em class="text-italics"><span style="color:#0080FF">delete m_solverIO;</span></em> into <em class="text-italics"><span style="color:#0080FF">delete [] m_solverIO;</span></em><br> - In PosixThreadSupport.cpp, i changed the mainSemaphore from a static pointer, to a static sem_t variable. <br>   The functions createSem and destroySem, do now have a sem_t pointer as argument, and do not allocate and delete on the heap. The deletion of the semaphore in destroySem caused the   crash.<br><br> - Just before someone asks why, i removed the most printfs in PosixThreadSupport.cpp, because they felt rather annoying to me.  <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"> <br><br>I hope i did this correctly without breaking things. All i can tell, is that at least Valgrind is showing 0 Errors now and my application doesnt crash anymore.  <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><dl class="file"><dt><span class="imageset icon_topic_attach"></span> <a class="postlink" href="https://pybullet.org/Bullet/phpBB3/download/file.php?id=1111">PosixThreadSupport.h</a></dt></dl><br /><dl class="file"><dt><span class="imageset icon_topic_attach"></span> <a class="postlink" href="https://pybullet.org/Bullet/phpBB3/download/file.php?id=1110">PosixThreadSupport.cpp</a></dt></dl><br /><dl class="file"><dt><span class="imageset icon_topic_attach"></span> <a class="postlink" href="https://pybullet.org/Bullet/phpBB3/download/file.php?id=1109">btParallelConstraintSolver.cpp</a></dt></dl><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10439">Sinsemilla</a> — Sun Sep 08, 2013 5:06 pm</p><hr />
]]></content>
	</entry>
	</feed>
