Thanks for the feedback!
You say you added null pointer checks. In the case of
// "Can clearly result in m_file being a nullptr when the file is not found."
ResourceStream::ResourceStream(const std::string& filename) :
m_file (NULL)
{
ActivityStates* states = getActivity(NULL);
Lock(states->mutex);
m_file = AAssetManager_open(states->activity->assetManager, filename.c_str(), AASSET_MODE_UNKNOWN);
}
how do you react? You can't really prevent a failure at that point.
// "Finally, this code uses "sf::priv::ResourceStream::tell()" to check if the file has actually
// opened, which results in the segfault, as it tries to call AAsset_getLength with a nullptr."
if (m_file)
delete m_file;
m_file = new priv::ResourceStream(filename);
return m_file->tell() != -1;
There's a
new operator right before, so
m_file can never be a null pointer in the last line.
Questionable however is the
if (m_file) delete m_file; statement.