![Very Happy :D](./images/smilies/icon_biggrin.gif)
I have had a really hard time trying to figure why irrlicht crashed apparently randomly when validating a file in my favorite open dialog box.
I finally succeded in figuring what happened really. It's definitly odd :
When I create an opendialog box, select a file and validate it, i receive an event called EGET_FILE_SELECTED. If I select nothing or a directory, I get the event EGET_DIRECTORY_SELECTED.
But now if I select a file but move the cursor a little while holding the left mouse pressed (but stay on the selected item when released = very small displacement while pressed), I receive both events ; 1st is the EGET_DIRECTORY_SELECTED and then the EGET_FILE_SELECTED one.
The only way to differenciate (hopefully there is one to let me handle this unexpected event) a real directory selection from a wrong directory selection is the function that get the file which is not an empty string in my case.
Where I call this unexpected is that I handle the case where I get a directory selected by doing some stuff (batching all file of the directory) and then remove my opendialog box (what is not done by default when the event EGET_DIRECTORY_SELECTED is received. And when the engine want to send me the 2nd event EGET_FILE_SELECTED, it simply crashes because the element doesn't exists anymore. I don't really know (i haven't checked the code for this error) why we get the event EGET_DIRECTORY_SELECTED when selecting a file with a mini drag&drop by mistake, but this mistake occures enough times to ask for a fix.