Excellent, worked like a charm. I had an uninitialized outlet pointer. *grin*<br><br>Thanks much for the gdb tip, I&#39;m certain it will come in handy often. <br><br>-Greg<br><br><br><br><div class="gmail_quote">On Sun, Mar 16, 2008 at 8:31 PM, Hans-Christoph Steiner &lt;<a href="mailto:hans@eds.org">hans@eds.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="">
<div><br></div><div>Crashes are usually because memory hasn&#39;t been allocated properly. &nbsp;I&#39;d check x-&gt;current and x-&gt;step. &nbsp;Hooking up to gdb will give you a lot more info. &nbsp;Search <a href="http://puredata.info" target="_blank">puredata.info</a> for &#39;gdb&#39; for a little howto.</div>
<div><br></div><div>.hc</div><br><div><div><div></div><div class="Wj3C7c"><div>On Mar 16, 2008, at 7:42 PM, Greg Surges wrote:</div><br></div></div><blockquote type="cite"><div><div></div><div class="Wj3C7c">Hi all,<br><br>
The following code crashes Pd when the randomwalk object receives a bang...<br>I&#39;m stuck as to why, can anyone see a reason?<br>void randomwalk_bang(t_randomwalk *x)<br>{<br>&nbsp;&nbsp;&nbsp; t_float randval = rand() % 2;<br> &nbsp;&nbsp;&nbsp; if(randval == 0) randval = -1;<br>
&nbsp;&nbsp;&nbsp; if(randval == 1) randval = 1;<br>&nbsp;&nbsp;&nbsp; x-&gt;current += (x-&gt;step * randval);<br>&nbsp;&nbsp;&nbsp; outlet_float(x-&gt;f_out, x-&gt;current);<br>}<br clear="all"><br>Thanks in advance,<br><br>-Greg<br> <br>-- <br><a href="http://www.uwm.edu/%7Egssurges/" target="_blank">http://www.uwm.edu/~gssurges/</a></div>
</div><div style="margin: 0px;">_______________________________________________</div><div style="margin: 0px;">PD-dev mailing list</div><div style="margin: 0px;"><a href="mailto:PD-dev@iem.at" target="_blank">PD-dev@iem.at</a></div>
<div style="margin: 0px;"><a href="http://lists.puredata.info/listinfo/pd-dev" target="_blank">http://lists.puredata.info/listinfo/pd-dev</a></div> </blockquote></div><br><div> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br>
<span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div>
<br></div><div>----------------------------------------------------------------------------</div><div><br></div><div>I spent 33 years and four months in active military service and during that period I spent most of my time as a high class muscle man for Big Business, for Wall Street and the bankers.&nbsp; &nbsp;&nbsp; &nbsp;- General Smedley Butler</div>
<br></span></span> </div><br></div></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.uwm.edu/~gssurges/">http://www.uwm.edu/~gssurges/</a>