About Store Forum Documentation Contact
Donations:
327$/mo



Post Reply 
Is del() required before a second create()
Author Message
fatcoder Offline
Member

Post: #1
Is del() required before a second create()
Quick question. I'm just wondering if it is necessary to call del() (on interfaces that provide it) before calling create() if you have already previously called create()?

For example, if you call create2D() on an image and then latter on need to recreate the image again, do you need to call del() on the image before calling create2D() again?

I know that del() is freeing resources, so I'm just wondering if by calling create2D() a second time without calling del(), will it leave behind some orphaned resources or does EE call del() for me when recreating something.
(This post was last modified: 01-06-2012 12:58 AM by fatcoder.)
01-06-2012 12:57 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Is del() required before a second create()
Manual calling del is NOT needed
01-06-2012 02:36 AM
Find all posts by this user Quote this message in a reply
JonathonA Offline
Member

Post: #3
RE: Is del() required before a second create()
.del() calls are not needed at all?
01-10-2012 11:58 PM
Visit this user's website Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #4
RE: Is del() required before a second create()
(01-10-2012 11:58 PM)JonathonA Wrote:  .del() calls are not needed at all?

No, calling del() is not required before calling create() a second time. Here's how I'm assuming it works.

create() <- first time
del() <- not needed here
create() <- recreate object second time (del called internally)
del() <- should be called when finished with object
01-11-2012 01:31 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Is del() required before a second create()
For most objects last del is also not needed
I mostly recommend calling del for global Thread objects to be stopped at custom position

It's not needed because you can see that destructors already call del
Investigate tutorials you will notice del is almost never called manually
01-11-2012 12:04 PM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #6
RE: Is del() required before a second create()
Ok, good to know.
01-11-2012 12:54 PM
Find all posts by this user Quote this message in a reply
Post Reply