-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception when a Shader object is deleted #17
Comments
I think __del__ is getting called after the deletion of everything. I've
seen this kind of error being reported on pybind11 for Python 3.9.0.
…On Sat, May 8, 2021 at 9:02 AM Obiwac ***@***.***> wrote:
When the Shader class' __del__ function is called, an exception occurs:
ImportError: sys.meta_path is None, Python is likely shutting down
Haven't had the time to investigate this more, but it's likely not too big
a problem as this only happens when __del__ is called on a Shader object,
so only when exiting the program.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#17>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQLDW4DHDYUQCRUVKLRPNTLTMTVZXANCNFSM44MN47DQ>
.
|
BTW: the 'I think __del__ is getting called after the deletion of
everything.' bit is incorrect, or there would be a SyntaxError. And, that
error is an error with the interpreter itself, so you can report it on the
Python forums.
…On Mon, May 10, 2021 at 8:38 PM Abhradeep De ***@***.***> wrote:
I think __del__ is getting called after the deletion of everything. I've
seen this error being reported on pybind11 for Python 3.9.0. It may cause
issues with your computer.
On Sat, May 8, 2021 at 9:02 AM Obiwac ***@***.***> wrote:
> When the Shader class' __del__ function is called, an exception occurs:
>
> ImportError: sys.meta_path is None, Python is likely shutting down
>
> Haven't had the time to investigate this more, but it's likely not too
> big a problem as this only happens when __del__ is called on a Shader
> object, so only when exiting the program.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#17>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AQLDW4DHDYUQCRUVKLRPNTLTMTVZXANCNFSM44MN47DQ>
> .
>
|
It's the destructor method for objects in Python, and one of the conditions for it to be called is indeed the program ending.
Sorry, I don't understand what you're referring to |
Same, what’s going on? Maybe you can add some debugging code, if you know
what I mean?
…On Thu, May 13, 2021 at 10:22 AM Obiwac ***@***.***> wrote:
I think __del__ is getting called after the deletion of everything.
It's the destructor method for objects in Python, and one of the
conditions for it to be called is indeed the program ending.
And, that error is an error with the interpreter itself, so you can report
it on the Python forums.
Sorry, I don't understand what you're referring to
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQLDW4G7XW64FZUYHEWN43TTNOK3TANCNFSM44MN47DQ>
.
|
What, post it out on their Twitter page or something, I can not do that as
I’m just an 8 year old lol
…On Thu, May 13, 2021 at 10:22 AM Obiwac ***@***.***> wrote:
I think __del__ is getting called after the deletion of everything.
It's the destructor method for objects in Python, and one of the
conditions for it to be called is indeed the program ending.
And, that error is an error with the interpreter itself, so you can report
it on the Python forums.
Sorry, I don't understand what you're referring to
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQLDW4G7XW64FZUYHEWN43TTNOK3TANCNFSM44MN47DQ>
.
|
Wait, did I just expose my age?? Uh-oh…
…On Sun, May 16, 2021 at 10:40 AM Abhradeep De ***@***.***> wrote:
What, post it out on their Twitter page or something, I can not do that as
I’m just an 8 year old lol
On Thu, May 13, 2021 at 10:22 AM Obiwac ***@***.***> wrote:
> I think __del__ is getting called after the deletion of everything.
>
> It's the destructor method for objects in Python, and one of the
> conditions for it to be called is indeed the program ending.
>
> And, that error is an error with the interpreter itself, so you can
> report it on the Python forums.
>
> Sorry, I don't understand what you're referring to
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#17 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AQLDW4G7XW64FZUYHEWN43TTNOK3TANCNFSM44MN47DQ>
> .
>
|
Python use some kind of garbage collector from what I know, and once a program ends it frees all memory allocated by destructing every object in existing variables. However idk if its actually del that's called, since the del keyword sometimes only deletes the reference to that variable, not the variable itself :/ |
|
the del method should set what it's deleting to none, then removing it from memory |
Sorry, could you elaborate on what you mean by that? |
Alright i've been digging through and i've got a better idea how del works. Python uses reference counting to handle objects, and once an object no longer has any references it destroys them. But guess what ? del deletes a reference. So theorically a unique reference variable should be deleted using del. However the question is whether del is really a destructor or rather a wrapper for using the del keyword |
There are no variables in python, just objects with references. Once there are no more references to an object, it will be deleted at some arbitrary future time (depending on the implementation, cpython is ref counted, and in cpython 2 at least it was quite deterministic (depends if there are circular references in your objects, which will still need broken by the so called garbage collector. pypy is usually compiled fully garbage collected, meaning it would happen whenever the gc runs.) Generally tl;dr it is best to avoid |
When the
Shader
class'__del__
function is called, an exception occurs:Haven't had the time to investigate this more, but it's likely not too big a problem as this only happens when
__del__
is called on a Shader object, so only when exiting the program.The text was updated successfully, but these errors were encountered: