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

Correcting a redundant invokation of pollEvents method, that was perm… #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CaiusCornelius
Copy link

…anently emptying the event queue.

The project invokes "pollEvents" twice, consecutively : one time (l162) as the "events" variable is initialized and one more time immediately after, in the for loop (l166).
Watchkey documentation tells:
"Events are retrieved by invoking the key's pollEvents method. This method retrieves and removes all events accumulated for the object."
As a consequence, the for loop tries continuously to scan an emptied liste of events because no file event could happen inbetween.
The solution is to use the created variable ("events") instead of re-invoking the pollEvents method on line 166.

It was for me the only way to make directories display. Hope this helps (far from beeing an experienced coder).

…anently emptying the event queue.

The project invokes "pollEvents" twice, consecutively : one time (l162) as the "events" variable is initialized and one more time immediately after, in the for loop (l166).
 Watchkey documentation tells:
"Events are retrieved by invoking the key's pollEvents method. This method retrieves and removes all events accumulated for the object."
As a consequence, the for loop tries continuously to scan an emptied liste of events because no file event could happen inbetween.
The solution is to use the created variable ("events") instead of re-invoking the pollEvents method on line 166.

It was for me the only way to make directories display. Hope this helps (far from beeing an experienced coder).
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 this pull request may close these issues.

None yet

1 participant