You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Safari Will Not Quit

Since upgrading to Lion I am unable to quit Safari from the Safari/Quit Safari menu. I get a beach ball that spins forever. The only way around it is to force quit.


I tried removing all the Safari related preferences in my home/library but no luck.


I then tried logging into a different user account. Safari quits every time without a problem! So the problem is in my account.


I am using Version 5.1 (7534.48.3)


Would appreciate any input that might help resolving this issue!

MacBook Pro 2.26 GHz, Mac OS X (10.6.5), 4 GB Ram

Posted on Jul 24, 2011 9:41 AM

Reply
Question marked as Top-ranking reply

Posted on Jul 24, 2011 4:24 PM

Problem solved. Here is the process I took:


First I forced quit Safari and went to both these locations and removed all the plugins (saving them to separate folders on the desktop so I could put them back if there was no change):


/Library/Internet Plug-Ins/

~/Library/Internet Plug-ins/ (The tilde (~) in the pathname is a shortcut for your user account name.)


No change so put them back.


Then I forced quit again and went to:


~/Library >Safari and dragged the content of that whole folder to a folder on the Desktop.


(Note: the user library "~/" is hidden in Lion. So make sure to click on finder > press and hold Option > click Go on the top menu > choose library)


Safari would quit normally! So the problem was one of the files in the Safari folder. I started putting them back in one by one and restarting and found that Databases/Databases.db was the culprit.


Here are the pages I used to solve the problem:


http://goo.gl/hl4p1

http://goo.gl/ITTXC

8 replies
Question marked as Top-ranking reply

Jul 24, 2011 4:24 PM in response to Peace-Freak

Problem solved. Here is the process I took:


First I forced quit Safari and went to both these locations and removed all the plugins (saving them to separate folders on the desktop so I could put them back if there was no change):


/Library/Internet Plug-Ins/

~/Library/Internet Plug-ins/ (The tilde (~) in the pathname is a shortcut for your user account name.)


No change so put them back.


Then I forced quit again and went to:


~/Library >Safari and dragged the content of that whole folder to a folder on the Desktop.


(Note: the user library "~/" is hidden in Lion. So make sure to click on finder > press and hold Option > click Go on the top menu > choose library)


Safari would quit normally! So the problem was one of the files in the Safari folder. I started putting them back in one by one and restarting and found that Databases/Databases.db was the culprit.


Here are the pages I used to solve the problem:


http://goo.gl/hl4p1

http://goo.gl/ITTXC

Oct 10, 2011 6:45 PM in response to Peace-Freak

PF, you are a genius. When I restarted after removing Databases.db Safari opened with a very large number of windows -- perhaps more than it can display. I spent some time closing windows; option close removed all but about 20 that I had to close one at a time, some full screen, some not.


Safari now quits properly.


Nasty bug, presumably related to the open all windows on crash/restart "feature". I remember that feature from OS/2(!), it was a bad idea then too.

Oct 11, 2011 10:35 AM in response to Peace-Freak

Over the last week, I have been experiencing exactly the same problem and have just managed to solve it.

The error reports which are generated are the same as yours (differing only in the computer hardware details), so I won't include them here. I have uninstalled and reinstalled Safari 5.1, done the same for all the Safari extensions and even reinstalled OSX 10.7 (Lion) all without success.


What I found in my case, was that one of the tabs in the Safari webpages I opened was corrupted. I believe that you mentioned that you too have a corrupted page/tab which is causing the crashes ?

Although I could open all the pages when Safari is restarted, clicking on a link from my email caused Safari to crash. In addition, trying to close the corrupted tab, the page it was attached to or even to close completely Safari caused it to crash.


Every time it crashes, Safari saves its "state" ready to be reloaded when it restarts. This "feature" has to be addressed in order to fix things.


Using the Apple file manager to remove the following information should solve your problem.

Follow these steps

Make sure that Safari is not running (or don't restart it if it has crashed)

Remove the contents of the directory {HOME}/Library/Saved Application State/com.applle.Safari.saved.State/

Remove the file {HOME}/Library/Safari/LastSession.plist

When you restart Safari, it will no longer load up the corrupted page or crash and should also open pages when you click email links.


If you wish to be more subtle and preserve most of your previously opened pages

Follow these steps

Make sure that Safari is not running (or don't restart it if it has crashed)

Remove the contents of the directory {HOME}/Library/Saved Application State/com.applle.Safari.saved.State/

Edit the file {HOME}/Library/Safari/LastSession.plist to remove the reference to the corrupted page and resave it. I managed to edit the file using Apple's Xcode editor but other software such as PListBuddy may work.

When you restart Safari, it will no longer load up the corrupted page or crash and should also open pages when you click email links.


I hope that this sorts your problem out and I also hope that Apple reads these messages (in addition to all the crash reports which have been sent to them). Corrupted pages/tabs should not cause the entire browser to crash. Very annoying.


regards


Andrew

Oct 28, 2011 5:17 PM in response to AndrewJBarton

In other threads I found that some people found that completely uninstalling Safari could do the trick.


Apparently removing these files:


HardDrive/Applications/Safari.app

home/library/Safari(folder)

home/library/Caches/com.apple.Safari(folder)

home/library/Caches/Metadata/Safari(folder)

home/library/Preferences/com.apple.Safari.plist


and any others that you see with Safari in their names is necessary.


These days the Safari application is part of the system and cannot be easily deleted but as long as the other files listed above are trashed it seems to work.


As Andrew Barton mentioned, it would not hurt to remove the Saved Application State files either from: /Library/Saved Application State/com.applle.Safari.saved.State/


Finally, remember to make a backup of your Safari bookmarks Bookmarks.plist which is in home/library/Safari.

Dec 1, 2011 8:35 PM in response to Peace-Freak

Thank you so much for this thread! This problem just recently popped up for me and it was quite frustrating to have four tabs and no way to close them. Then I realized I had another problem on my hand, the quit on Safari was greyed out.


But, by following instructions, I deleted plug-ins and now Safari works again. On top of that, when I restarted Safari a multitude of windows popped up. Again, thanks so much for helping me solve the problem.

Safari Will Not Quit

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.