Re: Infinit loop in TreeItemId operator ==

Michael Eddington <[email protected]> Tue, 6 Dec 2005 09:14:54 -0800
Newsgroups gmane.comp.lib.wxwindows.wxnet
Message-ID <[email protected]>
Actually, digging deeper, I found this function doesn't really work. 
If you hold onto a TreeItemId object and (say) in an event pull the
TreeItemId out of the event and compare they will *never* match.

In the end the comparision is if Object1.wxObject == Object1.wxObject
(the pointer), however anytime you get a TreeItemId it creates a new
object with a different wxObject even if it's the "same" TreeItemId.

And of course, this comparison occurs in a needless call to unmanaged code.

The fix to this is to modify TreeItemId to contain a long value to
compare against (this is the the C++ wxTreeItemId works, comparison
against internal value wxTreeItemIdValue).

Logging the bug.

mike

On 12/5/05, Michael J. Ryan <[email protected]> wrote:
> I think what you're looking for is,
> if (id1 == null || id2 == null)
>
> > On 11/29/05, *Michael Eddington* <[email protected]
> > When performing an if(id==null) in my code I started getting stack
> > overfow errors from this function.  I beleave the use of "==" inside
> > of the "operator ==" is causing an infinit loop?
> >
> >       if (id1 == null && id2 == null)
>
> --
> Michael J. Ryan - tracker1(at)theroughnecks(dot)com - www.theroughnecks.net
> icq: 4935386  -  AIM/AOL: azTracker1  -  Y!: azTracker1  -  MSN/Win: (email)
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> wxnet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wxnet-users
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click