<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: object_method(thePatcher, gensym(&quot;wclose&quot;)) makes Max unhappy</title>
		<atom:link href="http://cycling74.com/forums/topic/object_methodthepatcher-gensymwclose-makes-max-unhappy/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/object_methodthepatcher-gensymwclose-makes-max-unhappy/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 03:54:01 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/object_methodthepatcher-gensymwclose-makes-max-unhappy/#post-55314</guid>
					<title><![CDATA[object_method(thePatcher, gensym(&quot;wclose&quot;)) makes Max unhappy]]></title>
					<link>http://cycling74.com/forums/topic/object_methodthepatcher-gensymwclose-makes-max-unhappy/#post-55314</link>
					<pubDate>Thu, 03 Mar 2011 21:38:21 +0000</pubDate>
					<dc:creator>Peter Castine</dc:creator>

					<description>
						<![CDATA[
						<p>Consider the following code snippet, where &#8216;me&#8217; is a pointer to an arbitrary object</p>
<pre><code>Object*	thePatcher	= NULL;

object_obex_lookup(me, gensym("#P"), &#038;thePatcher);
	// ASSERT (thePatcher != NULL)
object_method(jpatcher_get_toppatcher(thePatcher), gensym("wclose"));</code></pre><p>This works in that the object closes its top-level patcher (and the rest of the patch it&#8217;s involved with). But it generates, as a rule, two &#8220;freeobject: < <br />
<address>>: bad object&#8221; messages in the Max window.</address></p>
<p>Is there a better way for an object to cleanly close its Patcher? The [thispatcher] object pulls the trick off, but how?</p>
<p>Searching the archives, I see Tim suggested the technique once (but I think without testing). I originally tried the somewhat more brutal</p>
<pre><code>object_free(jpatcher_get_toppatcher(thePatcher));</code></pre><p>but that also leads to the same bad object messages in the Max window.</p>
<p>I have reasons why I want to encapsulate this inside my object (rather than have the object send a wclose message for processing by thispatcher).</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/object_methodthepatcher-gensymwclose-makes-max-unhappy/#post-199088</guid>
					<title><![CDATA[Re: object_method(thePatcher, gensym(&#8220;wclose&#8221;)) makes Max unhappy]]></title>
					<link>http://cycling74.com/forums/topic/object_methodthepatcher-gensymwclose-makes-max-unhappy/#post-199088</link>
					<pubDate>Fri, 04 Mar 2011 07:26:42 +0000</pubDate>
					<dc:creator>nicolas danet</dc:creator>

					<description>
						<![CDATA[
						<p>Hello Peter,</p>
<p>i quickly implement the object_method function and i get no freeobject error message ; and it closes the topPatcher fine &#8230;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/object_methodthepatcher-gensymwclose-makes-max-unhappy/#post-199089</guid>
					<title><![CDATA[Re: object_method(thePatcher, gensym(&#8220;wclose&#8221;)) makes Max unhappy]]></title>
					<link>http://cycling74.com/forums/topic/object_methodthepatcher-gensymwclose-makes-max-unhappy/#post-199089</link>
					<pubDate>Fri, 04 Mar 2011 11:34:02 +0000</pubDate>
					<dc:creator>Peter Castine</dc:creator>

					<description>
						<![CDATA[
						<p>I could have sworn this was working without error messages last week. Then I ported to Windows and the error messages appeared. So I went back to Mac OS to check and, lo, there were error messages in the Max window.</p>
<p>For the record: occurs on both Mac OS and Windows, Max 5.1.7 (also occurred on a 5.0.x version on Windows before I updated to make sure it wasn&#8217;t a version issue). Building on Mac with XCode 3.2.1; Windows with Visual Studio 2010. </p>
<p>For what it&#8217;s worth: Overdrive was off on both machines. The machine I did this on before is 1000km away so I can&#8217;t easily check the Overdrive setting. But I just switched Overdrive on here (Mac) and&#8211;hey, presto!&#8211;no error messages. Ditto on Windows. Looks like an Overdrive issue.</p>
<p>OK, so, why should the setting of Overdrive influence whether there are error messages when closing the TLP and, more importantly, how do I avoid the freeobject errors?</p>
<p>I suppose I could add code to (1) check current state of overdrive, (2) turn it on, (3) kill patcher window, and (4) restore previous Overdrive state. Surely there is an easier way?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/object_methodthepatcher-gensymwclose-makes-max-unhappy/#post-199090</guid>
					<title><![CDATA[Re: object_method(thePatcher, gensym(&#8220;wclose&#8221;)) makes Max unhappy]]></title>
					<link>http://cycling74.com/forums/topic/object_methodthepatcher-gensymwclose-makes-max-unhappy/#post-199090</link>
					<pubDate>Fri, 04 Mar 2011 11:54:03 +0000</pubDate>
					<dc:creator>nicolas danet</dc:creator>

					<description>
						<![CDATA[
						<p>Hello Peter,</p>
<p>interesting as on my machine it seems to work fine (with or without Overdrive) ; i test few max menu configurations : and no freeobject bugs &#8230; with the C file joined previously, build with Xcode 2.5, last SDK, os X.4.11, maxMSP 5.1.7 &#8230;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/object_methodthepatcher-gensymwclose-makes-max-unhappy/#post-199091</guid>
					<title><![CDATA[Re: object_method(thePatcher, gensym(&#8220;wclose&#8221;)) makes Max unhappy]]></title>
					<link>http://cycling74.com/forums/topic/object_methodthepatcher-gensymwclose-makes-max-unhappy/#post-199091</link>
					<pubDate>Fri, 04 Mar 2011 14:47:11 +0000</pubDate>
					<dc:creator>Peter Castine</dc:creator>

					<description>
						<![CDATA[
						<p>Hmmm, Overdrive isn&#8217;t the issue for you. I have one more idea about where my problem is coming from, but I&#8217;d rather take that off-list.</p>
<p>Would anyone from Cycling &#8217;74 be interested in taking a look at the code in question?</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

