Skip to content
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

generateUniqueName is called twice in the open() member function #572

Closed
smlpt opened this issue Apr 12, 2024 · 3 comments · Fixed by #593
Closed

generateUniqueName is called twice in the open() member function #572

smlpt opened this issue Apr 12, 2024 · 3 comments · Fixed by #593

Comments

@smlpt
Copy link
Contributor

smlpt commented Apr 12, 2024

Nothing big, but I noticed that here and in a few other places generateUniqueName() is called before passing the node to addNode(), which in turns also calls generateUniqueName() again.

@kephale
Copy link
Member

kephale commented May 20, 2024

@smlpt i see the code you are pointing at but did you confirm that generateUniqueName() is actually repeatedly called? I did some quick checks with different node types that do call generateUniqueName before going on to call addNode. I didn't see multiple calls to generateUniqueName(). However, I didnt verify with a bdv xml though because i dont have one readily accessible.

@smlpt
Copy link
Contributor Author

smlpt commented May 21, 2024

@kephale so when I add an info log to generateUniqueName and add a box to the scene, it logs:

[INFO] generated unique name Box
[INFO] generated unique name Box

When I open an XML-based volume, it also logs:

[INFO] generated unique name C:\Software\datasets\MastodonTutorialDataset1\datasethdf5.xml
[INFO] generated unique name C:\Software\datasets\MastodonTutorialDataset1\datasethdf5.xml

And since most other primitives and file opening operations also call generateUniqueName before calling addNode, I suspect they all call the function twice.
I guess it won't make a difference, but it is probably not the intended behavior.

@kephale
Copy link
Member

kephale commented May 21, 2024

Upps, lol. Yes, when I saw this issue i thought "that should be a quick fix" so i made the fix, then tried to replicate the bug :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants