Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic deleting a table after attaching an arrow to it (Read 4587 times)
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
deleting a table after attaching an arrow to it
Jul 15th, 2009 at 12:39pm
Print Post  
I'm experiencing crashes when deleting tables with DeleteItem( ... ) once they've had arrows attached to them. Even calling BreakRelation doesn't prevent the crash. Is there any cleanup step I might be missing?
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: deleting a table after attaching an arrow to i
Reply #1 - Jul 15th, 2009 at 12:54pm
Print Post  
Are you handling the TableDeleted and ArrowDeleted events?
  
Back to top
 
IP Logged
 
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Re: deleting a table after attaching an arrow to i
Reply #2 - Jul 15th, 2009 at 1:04pm
Print Post  
No -- is there something I should be doing in them?

I'm experiencing other strange issues with arrows, though, such as the fact that my table becomes unstable once I've attached an arrow going from it to itself, but not when I've attached an arrow going from it to another table (until I try to delete the table), which means there might be something odd going on in my code, such as reference counts changing and objects being unexpected released...
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: deleting a table after attaching an arrow to i
Reply #3 - Jul 15th, 2009 at 1:22pm
Print Post  
Are you calling ->Release() on the deleted items after calling DeleteItem? The control is not consistent with COM in this case, and directly deletes the C++ object disregarding the reference count, so you should not call any of the item's members after DeleteItem.
  
Back to top
 
IP Logged
 
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Re: deleting a table after attaching an arrow to i
Reply #4 - Jul 15th, 2009 at 1:45pm
Print Post  
No, I'm not doing that, though I can't claim to understand completely what's going on behind the scenes as far as adding and removing references. I'm sure that's where the problem is.

It's always the destination table that blows up.
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: deleting a table after attaching an arrow to i
Reply #5 - Jul 15th, 2009 at 2:59pm
Print Post  
What happens if you save your flowchart to a file, load it in the fcdemo example, and delete a table from the context menu there?
  
Back to top
 
IP Logged
 
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Re: deleting a table after attaching an arrow to i
Reply #6 - Jul 15th, 2009 at 3:08pm
Print Post  
That works fine, as does creating the arrow outside of an event handler. What was breaking things was that I was manually setting the arrow's destination inside RequestCreateArrow (dragging over a box = dragging over a certain child table) when I probably should be doing that inside CreateArrow instead or during a post-event cleanup routine.

I think I'm okay now.
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint