New topic: 

Destructor called twice by Realbasic?

<http://forums.realsoftware.com/viewtopic.php?t=46466>

         Page 1 of 1
   [ 5 posts ]                 Previous topic | Next topic          Author  
Message        jens bendig          Post subject: Destructor called twice by 
Realbasic?Posted: Sun Jan 06, 2013 11:38 pm                         
Joined: Tue Mar 06, 2007 11:01 am
Posts: 1012
Location: Bremen, Germany                Hi Guys,

is it thinkable, that the destructor of an object is called twice? I think that 
I can observe this via a shared boolean property, set to true in constructor, 
set to false within destructor and causing an error in destructor, when already 
is false if enters the destructor...

Hm?

Jens   
                             Top                timhare          Post subject: 
Re: Destructor called twice by Realbasic?Posted: Mon Jan 07, 2013 1:13 am       
                  
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 11951
Location: Portland, OR  USA                Make it a normal property, not a 
shared property.  A shared property would cause problems if you instantiated 
and then freed more than one object.   
                             Top                jens bendig          Post 
subject: Re: Destructor called twice by Realbasic?Posted: Mon Jan 07, 2013 3:32 
am                         
Joined: Tue Mar 06, 2007 11:01 am
Posts: 1012
Location: Bremen, Germany                Hi Tim, 

I have an object that is instanciated once. But I think that maybe it is 
destructed twice. To measure that, I have introduced the shared Property. I am 
not sure, if your answer fits to my question. (I want my Object to be a 
singleton).

This shared Property also has the function to detect a secondary construction, 
what would lead to an error.

Jens   
                             Top                MonkeybreadSoftware          
Post subject: Re: Destructor called twice by Realbasic?Posted: Mon Jan 07, 2013 
3:47 am                                 
Joined: Wed May 10, 2006 2:42 pm
Posts: 2837
Location: Germany                Can you reproduce in a simple project?
In that case please report with Feedback so they can fix it.

Greetings
Christian      
_________________
See you in Orlando, Florida for Real World 2012
More details and registration here:
http://www.realsoftware.com/community/realworld.php  
                             Top                jens bendig          Post 
subject: Re: Destructor called twice by Realbasic?Posted: Mon Jan 07, 2013 6:45 
pm                         
Joined: Tue Mar 06, 2007 11:01 am
Posts: 1012
Location: Bremen, Germany                Christian,

unfortunately, this project is giant. It has grown over 5 years. But see you 
intend.
If you are in Bremen one day, I could show you. I have the feeling, that the 
double-call of the destructor has to do with the closure of a window, where the 
destructed object is a property on.

I tried to hope that this was just a misunderstanding on my side. However, I 
had to disable the code that detects this problem. Maybe I should upload the 
constructor and destructor-code and you can immediately see what I did wrong. 
And: In this project we still Use Realbasic 2009 because our customer wants the 
apps to run on very old machines...This keeps me a lot from playing around with 
the current RealStudio, sadly.

Hm. 

Jens   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 5 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to