Hi, i get a Doors Access Violation (not all the times) when i run this code:
It crash on the purge instruction. Once crash and the next time i relaunch it doesn't crash! bungle_77 - Tue Sep 30 10:36:51 EDT 2014 |
Re: Doors Access violation vene purging object The exception violation window is useless. However the dxl output pane should tell you which line of code caused the exception. [1] You want to avoid changing the existence of "something"s in any of the doors "for something in elsething do" loops. If you have a line of people and start from the beginning, figuring to go to the "next" person; but then rearrange the people or add people, you may not get to everybody or may bet to some folks twice. Instead, stage the "somethings" in a Skip list:
[2] In the above case I'm guessing that when you "softDelete o" you are also soft deleting all its children; when you get back to the top of the loop the object is now deleted, the next object is also deleted, and the loop gets confused since it finds non-deleted objects. You can put the objects in the skip, then plow through the skip, adding:
[3] I think you also need to "flushDeletions" after the loop, and probably after the purge. -Louie |
Re: Doors Access violation vene purging object llandale - Tue Sep 30 10:48:03 EDT 2014 The exception violation window is useless. However the dxl output pane should tell you which line of code caused the exception. [1] You want to avoid changing the existence of "something"s in any of the doors "for something in elsething do" loops. If you have a line of people and start from the beginning, figuring to go to the "next" person; but then rearrange the people or add people, you may not get to everybody or may bet to some folks twice. Instead, stage the "somethings" in a Skip list:
[2] In the above case I'm guessing that when you "softDelete o" you are also soft deleting all its children; when you get back to the top of the loop the object is now deleted, the next object is also deleted, and the loop gets confused since it finds non-deleted objects. You can put the objects in the skip, then plow through the skip, adding:
[3] I think you also need to "flushDeletions" after the loop, and probably after the purge. -Louie i changed my code according to your suggestion to
but i get still the same error on the purgeObjects_ instruction Anyway it succeed to purge and if i run again the script it doesn't crash because there are no objects to delete |
Re: Doors Access violation vene purging object bungle_77 - Tue Sep 30 11:04:12 EDT 2014 i changed my code according to your suggestion to
but i get still the same error on the purgeObjects_ instruction Anyway it succeed to purge and if i run again the script it doesn't crash because there are no objects to delete Don't know. It is working for me.
If the 1st pass aborts then probably some of the objects were purged. I'd take a close look at the object at the top that didn't purge. -Louie |
Re: Doors Access violation vene purging object llandale - Tue Sep 30 11:18:45 EDT 2014 Don't know. It is working for me.
If the 1st pass aborts then probably some of the objects were purged. I'd take a close look at the object at the top that didn't purge. -Louie The script is part of a bigger script. I have right onb all the object, i declare all the vairable correctly, i open in edit mode and the object has no incoming link but outcoming links. I changed the code like this and it's working
My module should not have children objects and i don't know if i can have some problem if there are objects with children. |
Re: Doors Access violation vene purging object bungle_77 - Tue Sep 30 11:40:51 EDT 2014 The script is part of a bigger script. I have right onb all the object, i declare all the vairable correctly, i open in edit mode and the object has no incoming link but outcoming links. I changed the code like this and it's working
My module should not have children objects and i don't know if i can have some problem if there are objects with children. Is sorting and filtering on? hardDelete() in the past only worked for undeleted objects. So you had to make sure it was not deleted. For soft deleted objects you would undelete them first. When you delete an object you also delete all its children; so restrictions on them apply also (no incoming links). I note you cannot insert objects when sorting and filtering is on since you really cannot tell where the new objects would end up in the hierarchy. Perhaps the same is true for deleting. -Louie |
Re: Doors Access violation vene purging object llandale - Tue Sep 30 13:39:32 EDT 2014 Is sorting and filtering on? hardDelete() in the past only worked for undeleted objects. So you had to make sure it was not deleted. For soft deleted objects you would undelete them first. When you delete an object you also delete all its children; so restrictions on them apply also (no incoming links). I note you cannot insert objects when sorting and filtering is on since you really cannot tell where the new objects would end up in the hierarchy. Perhaps the same is true for deleting. -Louie There is no sorting and no filter. But if i put all the objects in the skip list, if i delete a father object, the children objects in the skip list will be automatically deleted? will i find a null object? |
Re: Doors Access violation vene purging object bungle_77 - Wed Oct 01 04:12:45 EDT 2014 There is no sorting and no filter. But if i put all the objects in the skip list, if i delete a father object, the children objects in the skip list will be automatically deleted? will i find a null object? When you were "softDeleting" then the "Object" still exists and the handle in the Skip list is still valid; but for some they are now deleted. When hardDeleting, yes you have a problem. Yes, the Handle in the Skip List effectevly becomes corrupt. Turns out I ran into that too, here is my rather sloppy algorithm for dealing with it. You should be able to identify the parts you need.
|
Re: Doors Access violation vene purging object llandale - Thu Oct 02 11:52:26 EDT 2014 When you were "softDeleting" then the "Object" still exists and the handle in the Skip list is still valid; but for some they are now deleted. When hardDeleting, yes you have a problem. Yes, the Handle in the Skip List effectevly becomes corrupt. Turns out I ran into that too, here is my rather sloppy algorithm for dealing with it. You should be able to identify the parts you need.
what kind of library should i include tu have functions like fHardDelete, fConCat? Whi do you use sometimes "in_skpObjsToPurge" and sometimes "skpObjsToPurge" what's the defferences?
Thanks a lot for the support |
Re: Doors Access violation vene purging object bungle_77 - Fri Oct 03 05:54:01 EDT 2014 what kind of library should i include tu have functions like fHardDelete, fConCat? Whi do you use sometimes "in_skpObjsToPurge" and sometimes "skpObjsToPurge" what's the defferences?
Thanks a lot for the support I am getting fool, i have a module with many objects all at the same level!!! This objects have an outcoming link. Every two time i try to delete them Doors crash! Now i wrote also this code similar to your i hope
i put "//" becouse always crashed on that instruction and i think it's useless becouse i have no child requirement. The code always crash on flushDeletion and it return no error |
Re: Doors Access violation vene purging object bungle_77 - Fri Oct 03 05:54:01 EDT 2014 what kind of library should i include tu have functions like fHardDelete, fConCat? Whi do you use sometimes "in_skpObjsToPurge" and sometimes "skpObjsToPurge" what's the defferences?
Thanks a lot for the support fConCat just concatenates efficiently, you can just get rid of the function and concatenate normally. replace "fHardDelete" with "hardDelete"; I just wrote that to do extra error checking. As for your last code:
-Louie |