Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Exception thrown: read access violation. stream-> was nullptr.  (Read 2733 times)

0 Members and 1 Guest are viewing this topic.

kr3nshaw

  • Guest
I'm writing a class that inherits from InputStream so that I can read from custom archive formats. When I try and play a music file from the archive, the program crashes with the message shown in the subject. The source is ThreadFunc in Thread.inl. I know that the file loads successfully, because if I put a breakpoint in read, I can see the audio library moving around in the file. However, it always crashes after a few calls to read.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Exception thrown: read access violation. stream-> was nullptr.
« Reply #1 on: April 29, 2019, 12:55:44 pm »
Probably related to this:

Quote from: documentation
Warning

Since the music is not loaded at once but rather streamed continuously, the stream must remain accessible until the sf::Music object loads a new music or is destroyed.
Laurent Gomila - SFML developer

 

anything