src/audio/haiku/SDL_haikuaudio.cc
changeset 10255 9530fc07da6c
parent 10238 6fa358b97f4b
child 10257 f17581d00c26
     1.1 --- a/src/audio/haiku/SDL_haikuaudio.cc	Thu Aug 04 11:51:17 2016 -0400
     1.2 +++ b/src/audio/haiku/SDL_haikuaudio.cc	Fri Aug 05 01:44:41 2016 -0400
     1.3 @@ -74,16 +74,11 @@
     1.4  static void
     1.5  HAIKUAUDIO_CloseDevice(_THIS)
     1.6  {
     1.7 -    if (_this->hidden != NULL) {
     1.8 -        if (_this->hidden->audio_obj) {
     1.9 -            _this->hidden->audio_obj->Stop();
    1.10 -            delete _this->hidden->audio_obj;
    1.11 -            _this->hidden->audio_obj = NULL;
    1.12 -        }
    1.13 -
    1.14 -        delete _this->hidden;
    1.15 -        _this->hidden = NULL;
    1.16 +    if (_this->hidden->audio_obj) {
    1.17 +        _this->hidden->audio_obj->Stop();
    1.18 +        delete _this->hidden->audio_obj;
    1.19      }
    1.20 +    delete _this->hidden;
    1.21  }
    1.22  
    1.23  
    1.24 @@ -177,7 +172,6 @@
    1.25      }
    1.26  
    1.27      if (!valid_datatype) {      /* shouldn't happen, but just in case... */
    1.28 -        HAIKUAUDIO_CloseDevice(_this);
    1.29          return SDL_SetError("Unsupported audio format");
    1.30      }
    1.31  
    1.32 @@ -196,7 +190,6 @@
    1.33      if (_this->hidden->audio_obj->Start() == B_NO_ERROR) {
    1.34          _this->hidden->audio_obj->SetHasData(true);
    1.35      } else {
    1.36 -        HAIKUAUDIO_CloseDevice(_this);
    1.37          return SDL_SetError("Unable to start Be audio");
    1.38      }
    1.39