GithubHelp home page GithubHelp logo

Comments (4)

Ragora avatar Ragora commented on May 24, 2024

It looks like it could potentially just be the wrong variable being used there. Let me explain. According to the OpenALStream constructor, the mSource value will be set to 0: https://github.com/afritz1/OpenTESArena/blob/master/OpenTESArena/src/Media/AudioManager.cpp#L406

Cool, but the reason I say there might be wrong values in use here is the init itself using mSource:
https://github.com/afritz1/OpenTESArena/blob/master/OpenTESArena/src/Media/AudioManager.cpp#L477

Why? It appears maybe it wants to assert(source != 0) because we're initializing mSource with the source value input to ::init: https://github.com/afritz1/OpenTESArena/blob/master/OpenTESArena/src/Media/AudioManager.cpp#L510

Which makes sense as to why mSource might not be initialized (well, why it might be 0).

from opentesarena.

afritz1 avatar afritz1 commented on May 24, 2024

I have a feeling it should say assert(source != 0). @kcat?

@Ragora, I think you should use the link of the actual commit instead of using master. It would go out of date if master was updated, right?

from opentesarena.

Ragora avatar Ragora commented on May 24, 2024

Also ::reset will pretty much just reinitialize the unique_ptr with a new pointer value, destroying the old one if there is a non-NULL value stored: http://en.cppreference.com/w/cpp/memory/unique_ptr/reset

from opentesarena.

kcat avatar kcat commented on May 24, 2024

I have a feeling it should say assert(source != 0).

Actually that should've been assert(mSource == 0); to ensure the init method isn't being called again. The source parameter is valid, there's no way it can be called with 0 (if it is, there's more serious issues to worry about). I'll get a fix for that shortly.

Really annoying that cmake's RelWithDebInfo build type disables assertions, even though debug info is supposed to remain. I would've caught it earlier.

from opentesarena.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.