Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] Unusual segmentation error?
Forum Updated to NodeBB v4.3 + New Features

[solved] Unusual segmentation error?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IanBorn
    wrote on last edited by
    #1

    Adding more variables to Tutor class solved this unusual segmentation error. Thanks.

    The application is running correctly. Here is the code to initialize audio output :
    @
    void Tutor::init_audio_output()
    {
    has_audio_flag=true;
    QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
    if (devices.size()<1)
    {
    has_audio_flag=false;
    return;
    }
    format.setFrequency(11025);
    format.setChannels(1);
    format.setSampleSize(8);
    format.setSampleType(QAudioFormat::UnSignedInt);
    format.setByteOrder(QAudioFormat::LittleEndian);
    format.setCodec("audio/pcm");

    audioOutput = new QAudioOutput(format,this);
    if (audioOutput==NULL) 
    {
       has_audio_flag=false;
       return;
    }
    audioOutput->setBufferSize (MAX_BUFFER_SIZE);
    audioOutput->reset();
    

    }
    @

    But, when I cloase it, it give me this error :
    @
    QAudioOutputPrivate::~QAudioOutputPrivate()
    {
    EnterCriticalSection(&waveOutCriticalSection);
    finished = true;
    LeaveCriticalSection(&waveOutCriticalSection);

    close();
    DeleteCriticalSection(&waveOutCriticalSection);
    

    }
    0 ntdll!EtwEventWriteTransfer C:\Windows\system32\ntdll.dll 0 0x7772308e
    1 ntdll!EtwEventWriteTransfer C:\Windows\system32\ntdll.dll 0 0x77722f4c
    2 ~QAudioOutputPrivate qaudiooutput_win32_p.cpp 83 0x64dc5799
    3 ~QAudioOutput qaudiooutput.cpp 176 0x64dc2117
    4 QObjectPrivate::deleteChildren qobject.cpp 1978 0x6a20e234
    5 ~QWidget qwidget.cpp 1459 0x017ebec2
    6 ~QMainWindow qmainwindow.cpp 342 0x01b7df60
    7 ~Tutor tutor.cpp 299 0x0040a2f8
    8 qMain main.cpp 9 0x0040141d
    9 WinMain@16 qtmain_win.cpp 131 0x0050bb02
    10 main 0 0x0050b828

    @

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      That section of the code is not even mentioned in the output you provided, so why did you post it?

      1 Reply Last reply
      0
      • I Offline
        I Offline
        IanBorn
        wrote on last edited by
        #3

        The last code is what the Debugger said after I close the application.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          deimos
          wrote on last edited by
          #4

          2 cents for the close(); statement in ~QAudioOutputPrivate(). Try to remove it

          1 Reply Last reply
          0
          • I Offline
            I Offline
            IanBorn
            wrote on last edited by
            #5

            I did not close it. I let the c++ to do garbage collection. In ~Tutor(), I did not fo anything,
            not even delete ui.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved