File tree 1 file changed +8
-2
lines changed 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -722,7 +722,10 @@ struct FileWrap : public Napi::ObjectWrap<FileWrap>
722
722
~FileWrap ()
723
723
{
724
724
if (_fd) {
725
- PANIC (" FS::FileWrap::dtor: file not closed " << DVAL (_path) << DVAL (_fd));
725
+ LOG (" FS::FileWrap::dtor: file not closed " << DVAL (_path) << DVAL (_fd));
726
+ int r = ::close (_fd);
727
+ if (r) LOG (" FS::FileWrap::dtor: file close failed " << DVAL (_path) << DVAL (_fd) << DVAL (r));
728
+ _fd = 0 ;
726
729
}
727
730
}
728
731
Napi::Value close (const Napi::CallbackInfo& info);
@@ -1144,7 +1147,10 @@ struct DirWrap : public Napi::ObjectWrap<DirWrap>
1144
1147
~DirWrap ()
1145
1148
{
1146
1149
if (_dir) {
1147
- PANIC (" FS::DirWrap::dtor: dir not closed " << DVAL (_path) << DVAL (_dir));
1150
+ LOG (" FS::DirWrap::dtor: dir not closed " << DVAL (_path) << DVAL (_dir));
1151
+ int r = closedir (_dir);
1152
+ if (r) LOG (" FS::DirWrap::dtor: dir close failed " << DVAL (_path) << DVAL (_dir) << DVAL (r));
1153
+ _dir = 0 ;
1148
1154
}
1149
1155
}
1150
1156
Napi::Value close (const Napi::CallbackInfo& info);
You can’t perform that action at this time.
0 commit comments