-
Notifications
You must be signed in to change notification settings - Fork 60
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
Fix error in User_Memory_Init_Pools #1109
Fix error in User_Memory_Init_Pools #1109
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #1109 +/- ##
===========================================
- Coverage 2.54% 2.54% -0.01%
===========================================
Files 949 949
Lines 110299 110300 +1
Branches 18881 18881
===========================================
Hits 2802 2802
- Misses 107094 107095 +1
Partials 403 403 ☔ View full report in Codecov by Sentry. |
src/w3d/renderer/ddsfile.cpp
Outdated
@@ -592,6 +592,7 @@ bool DDSFileClass::Load() | |||
|
|||
if (data == 0) { | |||
captainslog_warn("DDSFile '%s' appears to contain no data, size is %d.", m_name, fp->Size()); | |||
fp->Close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto_file_ptr should indirectly be doing that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it does not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, comment as bugfix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the right fix here is then to auto close on destruction of auto_file_ptr
instead.
I will take a look if there are more places where auto_file_ptr
is missing call to Close.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original auto_file_ptr didn't call Close, we should keep it that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reverted change to DDSFileClass::Load and will make a new Pull for auto_file_ptr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have taken another look at auto_file_ptr
and GameFileClass
in debugger. It does call Close
on destruction via virtual destructor:
GameFileClass::~GameFileClass()
{
Close();
}
So this needs no change.
e1209f8
to
04d1fc5
Compare
04d1fc5
to
1105b4e
Compare
This claims to be a fix for a Thyme specific issue.