-
Notifications
You must be signed in to change notification settings - Fork 69
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
BaseObject's parent pointer variable not initialized? #14
Comments
I think I found the issue.
Here in Now, I actually thought you could do something like this instead:
But it turns out that this doesn't fix the problem. Unless you happen to have a solution in mind, the only other way I know of to fix this is to turn Edit: Someone brought to my attention that
|
See ac16cd8 for the solution I went with. |
Hi, I believe all the pointers were already removed altogether in 6bf1ed0. If it's at all possible I would recommend merging with that commit. It removes a LOT of my convoluted code and other messy stuff, + better explanation comments. (or even later 323b441) Otherwise let me know if you need any help even with the older commits. I might have to go through them a bit though. |
I'm working on a serializer for ImStudio so that I can save and load GUI projects (using yaml-cpp).
Admittedly, I'm not super familiar with how ImStudio stores and looks up children/parents, or rather, how the object hierarchy works, at the moment.
I wrote something like this pseudo code:
I then tested this serialization with a few widgets (no nesting) in a window, and the objects' parent ID always serialize as:
ParentID: 30198988
(This turns out to be 0x01CCCCCC, probably some kind of magic number.)
I tried adding the line
parent = nullptr;
to BaseObject's constructor, but this doesn't seem to make a difference.And also, when I put in a break point and look at the object that is currently being serialized, the obj.parent doesn't appear to be valid memory.
I was hoping you might be able to see if you have similar results with your object.parent, or if it's just something I did.
Also, I did notice that in the Object constructor, it seems to set itself as the parent of itself, so I'm thinking I may be misunderstanding your data structure, and it isn't tree-like?
The text was updated successfully, but these errors were encountered: