-
Notifications
You must be signed in to change notification settings - Fork 35
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
error on view3D.dispose() (i now provided my code) #56
Comments
i feel this is a very important issue |
ok i provide my code, has HaxeFlixel use |
an easily testable project: https://github.com/doggy-dentures/3dsenpai/tree/main |
You copy pasted a decade old issue verbatim without providing a lot of information about your actual problem. All of the libraries have changed drastically. Calling dispose is supposed to clean things up. A null reference occurs when you try to use a reference that doesn't point to anything. If this is happening, somewhere in your code, it is trying to access something that is now null after dispose is called. It could be an away3d issue or it might be openfl, or flixel, or your own code. Its hard to tell without a minimal reproducible example. Maybe these libraries aren't playing nice together. I couldn't reproduce the issue on my own. I suspect its not necessarily an away 3d problem. Come back with an easily reproducible, minimal example and create a better issue report. The burden to prove there is a bug is on users. We don't have time to investigate everyone's code when the user themselves haven't put in the minimal required effort to help us debug. |
i copied the code into a minimal project, and i have now uploaded it at https://github.com/VMan-2002/AwayViewBug |
The problem exists outside of away3d and in the actual project then I'm afraid. The callstack will tell you where to look. |
ok i discovered something: the bug depends on the |
I will take a look when I get a chance this week. |
Show me the callstack please. @VMan-2002 |
|
Okay it looks like the gl context may already be null. This may be an openfl issue. I'm on my phone right now so I can't make the change and send you a branch, you'll have to try this yourself. go to https://github.com/openfl/openfl/blob/c7861adaca97dff8697b334162a04a60e5d7090b/src/openfl/display3D/Program3D.hx#L586 in your openfl version or branch and replace the function as follows: @:noCompletion private function __deleteShaders():Void
{
var gl = __context.gl;
if (__glProgram != null)
{
__glProgram = null;
}
if (__glVertexShader != null)
{
if(gl != null) gl.deleteShader(__glVertexShader);
__glVertexShader = null;
}
if (__glFragmentShader != null)
{
if(gl != null) gl.deleteShader(__glFragmentShader);
__glFragmentShader = null;
}
} let me know if that solves your problem. |
Feel free to join our discord if you want realtime support and feedback from the community. https://discord.gg/gzTnHZybr7 |
Error occurs when trying to dispose a View3D.
Original issue (possibly outdated) in 2015 by ramsestom from away3d/away3d-core-openfl
I have an ObjectContainer3D OC1 that contains 2 other ObjectContainer3D OC2 and OC3 (containing each one a mesh).
If I add only OC1 as child to my view3D, calling the view3D.dispose() function make the program to crash with this error:
Now, If my ObjectContainer3D OC1 only contains 1 Mesh (instead of OC2 and OC3), there is no error. view3D.dispose() succed. The same thing if I I only put OC2 (with 1 mesh) as child of OC1 (so whithout OC3) and then put OC1 as single child of view3D (everything is fine in that case). The issue only appear if I have in my view3D an ObjectContainer3D with more than 1 child in it...
The text was updated successfully, but these errors were encountered: