Dear community,<br><br>I hope in your help. I suppose I'm doing some errors with function pointer and I'm completely stopped on this point.<br>When the program goes from the SingleStep Method to the ContinueAfterOption Method I see that the screenwidget variables loose their right value and feels as undefined.<br>
<br>Please, help me. I attach the Qt Project.<br>-Antonio<br><br><div class="gmail_quote">2011/10/31 antonio nunziante <span dir="ltr"><<a href="mailto:nunzianteantonio@gmail.com">nunzianteantonio@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br><br>i have the error the second time I call the method SingleStep(0) in my doEventLoop() method.<br><br>It occurs in this block of instructions (exactly at the instruction<span style="color:#c0c0c0"> </span><span style="color:#000000">(*</span><span style="color:#000000">handler</span><span style="color:#000000">-></span><span style="color:#800000">handlerProc</span><span style="color:#000000">)(</span><span style="color:#000000">handler</span><span style="color:#000000">-></span><span style="color:#800000">clientData</span><span style="color:#000000">,</span><span style="color:#c0c0c0"> </span><span style="color:#000000">resultConditionSet</span><span style="color:#000000">)</span>
)<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"></span><span style="color:#000000"></span><font size="4"><br></font></pre>
<font size="4"><span style="color:rgb(128, 128, 0)">if</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">(</span><span style="color:rgb(0, 0, 0)">handler</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">==</span><span style="color:rgb(192, 192, 192)"> </span>NULL<span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">&&</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(128, 0, 0)">fLastHandledSocketNum</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">>=</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 128)">0</span><span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">{</span>
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(0, 128, 0)">//</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">We</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">didn't</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">call</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">a</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">handler,</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">but</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">we</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">didn't</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">get</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">to</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">check</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">all</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">of</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">them,</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(0, 128, 0)">//</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">so</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">try</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">again</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">from</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">the</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">beginning:</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(0, 0, 0)">iter</span><span style="color:rgb(0, 0, 0)">.</span>reset<span style="color:rgb(0, 0, 0)">();</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(128, 128, 0)">while</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">((</span><span style="color:rgb(0, 0, 0)">handler</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">=</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">iter</span><span style="color:rgb(0, 0, 0)">.</span>next<span style="color:rgb(0, 0, 0)">())</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">!=</span><span style="color:rgb(192, 192, 192)"> </span>NULL<span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">{</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">      </span><span style="color:rgb(128, 128, 0)">int</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">sock</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">=</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">handler</span><span style="color:rgb(0, 0, 0)">-></span><span style="color:rgb(128, 0, 0)">socketNum</span><span style="color:rgb(0, 0, 0)">;</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">//</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">alias</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">      </span><span style="color:rgb(128, 128, 0)">int</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">resultConditionSet</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">=</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 128)">0</span><span style="color:rgb(0, 0, 0)">;</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">      </span><span style="color:rgb(128, 128, 0)">if</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">(</span>FD_ISSET<span style="color:rgb(0, 0, 0)">(</span><span style="color:rgb(0, 0, 0)">sock</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">&</span><span style="color:rgb(0, 0, 0)">readSet</span><span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">&&</span><span style="color:rgb(192, 192, 192)"> </span>FD_ISSET<span style="color:rgb(0, 0, 0)">(</span><span style="color:rgb(0, 0, 0)">sock</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">&</span><span style="color:rgb(128, 0, 0)">fReadSet</span><span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(0, 128, 0)">/*sanity</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">check*/</span><span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">resultConditionSet</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">|=</span><span style="color:rgb(192, 192, 192)"> </span>SOCKET_READABLE<span style="color:rgb(0, 0, 0)">;</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">      </span><span style="color:rgb(128, 128, 0)">if</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">(</span>FD_ISSET<span style="color:rgb(0, 0, 0)">(</span><span style="color:rgb(0, 0, 0)">sock</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">&</span><span style="color:rgb(0, 0, 0)">writeSet</span><span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">&&</span><span style="color:rgb(192, 192, 192)"> </span>FD_ISSET<span style="color:rgb(0, 0, 0)">(</span><span style="color:rgb(0, 0, 0)">sock</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">&</span><span style="color:rgb(128, 0, 0)">fWriteSet</span><span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(0, 128, 0)">/*sanity</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">check*/</span><span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">resultConditionSet</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">|=</span><span style="color:rgb(192, 192, 192)"> </span>SOCKET_WRITABLE<span style="color:rgb(0, 0, 0)">;</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">      </span><span style="color:rgb(128, 128, 0)">if</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">(</span>FD_ISSET<span style="color:rgb(0, 0, 0)">(</span><span style="color:rgb(0, 0, 0)">sock</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">&</span><span style="color:rgb(0, 0, 0)">exceptionSet</span><span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">&&</span><span style="color:rgb(192, 192, 192)"> </span>FD_ISSET<span style="color:rgb(0, 0, 0)">(</span><span style="color:rgb(0, 0, 0)">sock</span><span style="color:rgb(0, 0, 0)">,</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">&</span><span style="color:rgb(128, 0, 0)">fExceptionSet</span><span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(0, 128, 0)">/*sanity</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">check*/</span><span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">resultConditionSet</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">|=</span><span style="color:rgb(192, 192, 192)"> </span>SOCKET_EXCEPTION<span style="color:rgb(0, 0, 0)">;</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">      </span><span style="color:rgb(128, 128, 0)">if</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">((</span><span style="color:rgb(0, 0, 0)">resultConditionSet</span><span style="color:rgb(0, 0, 0)">&</span><span style="color:rgb(0, 0, 0)">handler</span><span style="color:rgb(0, 0, 0)">-></span><span style="color:rgb(128, 0, 0)">conditionSet</span><span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">!=</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 128)">0</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">&&</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">handler</span><span style="color:rgb(0, 0, 0)">-></span><span style="color:rgb(128, 0, 0)">handlerProc</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">!=</span><span style="color:rgb(192, 192, 192)"> </span>NULL<span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">{</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">        </span><span style="color:rgb(128, 0, 0)">fLastHandledSocketNum</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">=</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">sock</span><span style="color:rgb(0, 0, 0)">;</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">            </span><span style="color:rgb(0, 128, 0)">//</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">Note:</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">we</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">set</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">"fLastHandledSocketNum"</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">before</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">calling</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">the</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">handler,</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">            </span><span style="color:rgb(0, 128, 0)">//</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">in</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">case</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">the</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">handler</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">calls</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">"doEventLoop()"</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">reentrantly.</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">        </span><span style="color:rgb(0, 0, 0);background-color:rgb(255, 255, 51)">(*handler-></span><span style="color:rgb(128, 0, 0);background-color:rgb(255, 255, 51)">handlerProc</span><span style="color:rgb(0, 0, 0);background-color:rgb(255, 255, 51)">)(handler-></span><span style="color:rgb(128, 0, 0);background-color:rgb(255, 255, 51)">clientData</span><span style="color:rgb(0, 0, 0);background-color:rgb(255, 255, 51)">,</span><span style="color:rgb(192, 192, 192);background-color:rgb(255, 255, 51)"> </span><span style="color:rgb(0, 0, 0);background-color:rgb(255, 255, 51)">resultConditionSet);</span></font></pre>

<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">        </span><span style="color:rgb(128, 128, 0)">break</span><span style="color:rgb(0, 0, 0)">;</span></font></pre>
<font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">      </span><span style="color:rgb(0, 0, 0)">}</span></font></pre><font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(0, 0, 0)">}</span></font></pre><font size="4">
</font><pre style="margin:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(128, 128, 0)">if</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">(</span><span style="color:rgb(0, 0, 0)">handler</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">==</span><span style="color:rgb(192, 192, 192)"> </span>NULL<span style="color:rgb(0, 0, 0)">)</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(128, 0, 0)">fLastHandledSocketNum</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">=</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 0, 0)">-</span><span style="color:rgb(0, 0, 128)">1</span><span style="color:rgb(0, 0, 0)">;</span><span style="color:rgb(0, 128, 0)">//because</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">we</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">didn't</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">call</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">a</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 128, 0)">handler</span></font></pre>

<font size="4">
</font><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><font size="4"><span style="color:rgb(192, 192, 192)">  </span></font><span style="color:#000000"><font size="4">}</font><br>

<br><br><font size="4">Could I attach my code?</font><br></span></pre><br>Thank you<br>-Antonio<br><br><div class="gmail_quote">2011/10/28 Ross Finlayson <span dir="ltr"><<a href="mailto:finlayson@live555.com" target="_blank">finlayson@live555.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5"><div style="word-wrap:break-word"><div><div><blockquote type="cite">I'm trying to implement a GUI with QtWidget in order to show video frame from a rtsp camera.<br>

<br>I started from the code of openRTSP and I modified it in order to have c++ classes.<br><br>After it runs:<br>
<br><span style="color:#800000">env</span><span style="color:#000000">-></span>taskScheduler<span style="color:#000000">().</span><span style="font-style:italic;color:#000000">doEventLoop</span><span style="color:#000000">();</span><br>


<br>it comes back to the "continueAfterOPTIONS" member function. The problem is that all class variables lose their values, probably a problem with memory management.<br></blockquote><div><br></div></div>The problem is more likely to be that you're not using this function correctly.  Note that the "continueAfterOPTIONS()" function (and the other "continueAfter...()" functions) take a "RTSPClient*" as the first parameter.  In the current code, this parameter is not used (because we have only one "RTSPClient" object, which is a global variable "ourRTSPClient").  However, if you want to use this code in your own custom application - where the "RTSPClient" object is not a global variable (or there's more than one "RTSPClient" object) - then you will need to use this first parameter to the "continueAfter...()" functions; it will point to the "RTSPClient" object.</div>

<br><font color="#888888"><br><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">Ross Finlayson<br>

Live Networks, Inc.<br><a href="http://www.live555.com/" target="_blank">http://www.live555.com/</a></span></span>
</div>
<br></font></div><br></div></div>_______________________________________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com" target="_blank">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" target="_blank">http://lists.live555.com/mailman/listinfo/live-devel</a><br>
<br></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br><i><div><span style="font-style:normal"><i>Antonio Nunziante</i></span></div></i><br>
<div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%">
</div>
</font></blockquote></div><br><br clear="all"><br>-- <br><i><div><span style="font-style:normal"><i>Antonio Nunziante</i></span></div></i><br>
<div style="visibility: hidden; left: -5000px; position: absolute; z-index: 9999; padding: 0px; margin-left: 0px; margin-top: 0px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;" id="avg_ls_inline_popup">
</div>