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

feat: Windows環境でFILE_FLAG_DELETE_ON_CLOSEを付けて開かれている辞書を扱えるようにする #13

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

sabonerune
Copy link

内容

CreateFileW関数のdwShareModeFILE_SHARE_DELETEを追加します。

これによりプロセス終了時や辞書切り替え時にユーザー辞書を自動的に削除することが可能になります。

詳細は VOICEVOX/voicevox_engine#1347 (comment) を参照。

関連 Issue

その他

CreateFileW

@@ -107,7 +107,7 @@ template <class T> class Mmap {
#if 0 /* for Open JTalk */
hFile = ::CreateFileA(filename, mode1, FILE_SHARE_READ, 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こっちも変えとくのどうでしょう? 👀
こう?

Suggested change
hFile = ::CreateFileA(filename, mode1, FILE_SHARE_READ, 0,
hFile = ::CreateFileA(filename, mode1, FILE_SHARE_READ | FILE_SHARE_DELETE, 0,

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

追加しました。

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PRありがとうございます!!

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

PRのタイトルは「辞書ファイルを開いているときに削除可能にする」とかが合ってそうな気もしますが、MMapの影響で結局削除できないし、この内容で良さそう!

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.

2 participants