Fix Windows issue with files being exclusively owned by shex once opened#13
Open
Atari2 wants to merge 3 commits intop4plus2:masterfrom
Open
Fix Windows issue with files being exclusively owned by shex once opened#13Atari2 wants to merge 3 commits intop4plus2:masterfrom
Atari2 wants to merge 3 commits intop4plus2:masterfrom
Conversation
Currently when opening a rom in shex, shex will keep the QFile object open. This, on Windows, causes the rom to be impossible to open in certain other programs (e.g. BizHawk), with an error like "This file is already open in another process (shex.exe)". Since keeping the QFile object open is not necessary, the fix for this issue is simply to close the QFile after reading all of its data and then re-opening it only once we want to write into it. This patch is simple and it doesn't do any error checking on open/read/write, because the code that was already existing didn't do any error checking either.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently when opening a rom in shex, shex will keep the QFile object open.
This, on Windows, causes the rom to be impossible to open in certain other programs (e.g. BizHawk), with an error like "This file is already open in another process (shex.exe)".
Since keeping the QFile object open is not necessary, the fix for this issue is simply to close the QFile after reading all of its data and then re-opening it only once we want to write into it.
This patch is simple and it doesn't do any error checking on open/read/write, because the code that was already existing didn't do any error checking either.
This patch also fixes a few missing or misplaced
emitkeywords as reported by QtCreator.