Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8253893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:01:58+00:00 2026-06-08T01:01:58+00:00

In my iPhone app I have an instance of AVAudioPlayer which I release (so

  • 0

In my iPhone app I have an instance of AVAudioPlayer which I release (so that I can then initialize another one with a different URL in its place). Normally this works fine, but occasionally I get a deadlock on the main thread:

Thread 1, Queue : com.apple.main-thread
#0  0x357e00d8 in __psynch_mutexwait ()
#1  0x3497d67a in pthread_mutex_lock ()
#2  0x359997a6 in -[AVAudioPlayer privCommonCleanup] ()
#3  0x35999bb6 in -[AVAudioPlayer dealloc] ()
#4  0x3338a174 in _objc_rootRelease ()

The app just stalls, accepting no input. No crash or anything, it just stops.

It doesn’t seem to be interacting with any of the other threads in the app, but for completeness here they are:

Thread 2, Queue : com.apple.libdispatch-manager
#0  0x357d03a8 in kevent ()
#1  0x33b03eaa in _dispatch_mgr_invoke ()
#2  0x33b03bc8 in _dispatch_mgr_thread ()
Thread 3, Queue : (null)
#0  0x357e0cd4 in __workq_kernreturn ()
#1  0x34983f3c in _pthread_wqthread ()
#2  0x34983cd0 in start_wqthread ()
Thread 4 WebThread, Queue : (null)
#0  0x357d0004 in mach_msg_trap ()
#1  0x357d0200 in mach_msg ()
#2  0x3573e3f2 in __CFRunLoopServiceMachPort ()
#3  0x3573d12a in __CFRunLoopRun ()
#4  0x356c04a4 in CFRunLoopRunSpecific ()
#5  0x356c036c in CFRunLoopRunInMode ()
#6  0x37406ca2 in _ZL12RunWebThreadPv ()
#7  0x34989734 in _pthread_start ()
#8  0x349895f0 in thread_start ()
Thread 5, Queue : (null)
#0  0x357e0cd4 in __workq_kernreturn ()
#1  0x34983f3c in _pthread_wqthread ()
#2  0x34983cd0 in start_wqthread ()
Thread 6 AQClient, Queue : (null)
#0  0x357d0004 in mach_msg_trap ()
#1  0x357d0200 in mach_msg ()
#2  0x3573e3f2 in __CFRunLoopServiceMachPort ()
#3  0x3573d12a in __CFRunLoopRun ()
#4  0x356c04a4 in CFRunLoopRunSpecific ()
#5  0x356c036c in CFRunLoopRunInMode ()
#6  0x34e2cb2e in GenericRunLoopThread::Entry(void*) ()
#7  0x34db3ca2 in CAPThread::Entry(CAPThread*) ()
#8  0x34989734 in _pthread_start ()
#9  0x349895f0 in thread_start ()
Thread 7, Queue : (null)
#0  0x357d0004 in mach_msg_trap ()
#1  0x357d0200 in mach_msg ()
#2  0x3573e3f2 in __CFRunLoopServiceMachPort ()
#3  0x3573d12a in __CFRunLoopRun ()
#4  0x356c04a4 in CFRunLoopRunSpecific ()
#5  0x356c036c in CFRunLoopRunInMode ()
#6  0x34af9b74 in -[NSRunLoop(NSRunLoop) runMode:beforeDate:] ()
#7  0x34b13522 in -[NSRunLoop(NSRunLoop) run] ()
#8  0x000c83fe in +[AFURLConnectionOperation networkRequestThreadEntryPoint:] at /Users/hiltonc/Documents/Code/LDSMobileApps/LDSScriptureHeroes/External/LDSMobileAccount/External/AFNetworking/AFNetworking/AFURLConnectionOperation.m:151
#9  0x34b05a80 in -[NSThread main] ()
Thread 8 com.apple.NSURLConnectionLoader, Queue : (null)
#0  0x357d0004 in mach_msg_trap ()
#1  0x357d0200 in mach_msg ()
#2  0x3573e3f2 in __CFRunLoopServiceMachPort ()
#3  0x3573d12a in __CFRunLoopRun ()
#4  0x356c04a4 in CFRunLoopRunSpecific ()
#5  0x356c036c in CFRunLoopRunInMode ()
#6  0x34b05bb8 in +[NSURLConnection(Loader) _resourceLoadLoop:] ()
#7  0x34b05a80 in -[NSThread main] ()
Thread 12 com.apple.CFSocket.private, Queue : (null)
#0  0x357e0570 in select$DARWIN_EXTSN ()
#1  0x35742640 in __CFSocketManager ()
#2  0x34989734 in _pthread_start ()
#3  0x349895f0 in thread_start ()

I really have no idea how to get to the bottom of this issue. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:01:59+00:00Added an answer on June 8, 2026 at 1:01 am

    Releasing one and replacing it in a delegate call will surely cause this type of problem. Esentially you want to run (under ARC):

    avPlayer.delegate = nil
    [avPlayer stop];
    avPlayer = nil; //overkill
    avPlayer = [AVPlayer alloc] init....
    avPlayer ....
    

    If you find you need to do the above in a delegate method, then just wrap the above code in a block and dispatch it to the main queue (I’m assuming avPlayer is an ivar or property).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my iPhone app I have a UIViewController that has a UITableView and another
I have a simple iPhone app which accesses some remote data on start-up then
I have a few variables in my iPhone app as class instance variables (which
Working on an iPhone app where I have a class instance that is defined
I have a UIWebView in my iPhone app that have a web page with
I'm creating an iPhone app that will have a preloaded set of locations with
I have an app which existed as an iPhone app first and now as
I currently have an iPhone app that lets the users take video, upload it
I have an iPhone app that I've built for the app store. Before I
I have a simple iPhone app that Im learning and I want to have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.