Make sure the recording thread in sf::SoundRecorder is stopped before sf::SoundBufferRecorder is destroyed.

Fixes a "pure virtual method called" crash.
Also updated the documentation and the VoIP example.
This commit is contained in:
Maximilian Wagenbach 2015-10-02 14:49:00 +02:00 committed by Lukas Dürrenberger
parent e00d160224
commit 1ee6d1dbc6
5 changed files with 54 additions and 10 deletions

View file

@ -45,6 +45,12 @@ class SFML_AUDIO_API SoundBufferRecorder : public SoundRecorder
{
public:
////////////////////////////////////////////////////////////
/// \brief destructor
///
////////////////////////////////////////////////////////////
~SoundBufferRecorder();
////////////////////////////////////////////////////////////
/// \brief Get the sound buffer containing the captured audio data
///

View file

@ -316,11 +316,20 @@ private:
/// from this separate thread. It is important to keep this in
/// mind, because you may have to take care of synchronization
/// issues if you share data between threads.
/// Another thing to bear in mind is that you must call stop()
/// in the destructor of your derived class, so that the recording
/// thread finishes before your object is destroyed.
///
/// Usage example:
/// \code
/// class CustomRecorder : public sf::SoundRecorder
/// {
/// ~CustomRecorder()
/// {
/// // Make sure to stop the recording thread
/// stop();
/// }
///
/// virtual bool onStart() // optional
/// {
/// // Initialize whatever has to be done before the capture starts