Skip to content

Commit f61e6a3

Browse files
committed
OpenAL api usage fix
AL_LOOPING should really be set with `alSourcei` + fix potential nullptr dereference in `GLRenderAPI::destroyCore` + reworded a few docs in BsException.h
1 parent bbcebba commit f61e6a3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Source/Plugins/bsfGLRenderAPI/BsGLRenderAPI.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ namespace bs { namespace ct
225225
mCurrentDomainProgram = nullptr;
226226
mCurrentComputeProgram = nullptr;
227227

228-
mGLSupport->stop();
228+
if (mGLSupport)
229+
mGLSupport->stop();
229230

230231
TextureManager::shutDown();
231232
bs::TextureManager::shutDown();

Source/Plugins/bsfOpenAudio/BsOAAudioSource.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ namespace bs
115115
if (contexts.size() > 1)
116116
alcMakeContextCurrent(contexts[i]);
117117

118-
alSourcef(mSourceIDs[i], AL_LOOPING, loop);
118+
alSourcei(mSourceIDs[i], AL_LOOPING, loop);
119119
}
120120
}
121121

@@ -397,9 +397,9 @@ namespace bs
397397
alSourcef(mSourceIDs[i], AL_ROLLOFF_FACTOR, mAttenuation);
398398

399399
if(requiresStreaming())
400-
alSourcef(mSourceIDs[i], AL_LOOPING, false);
400+
alSourcei(mSourceIDs[i], AL_LOOPING, false);
401401
else
402-
alSourcef(mSourceIDs[i], AL_LOOPING, mLoop);
402+
alSourcei(mSourceIDs[i], AL_LOOPING, mLoop);
403403

404404
if (is3D())
405405
{

0 commit comments

Comments
 (0)