Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Black Dragon Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Logue
Black Dragon Viewer
Commits
bf1e9124
Commit
bf1e9124
authored
12 years ago
by
Geenz
Browse files
Options
Downloads
Patches
Plain Diff
Restore the old Carbon crash handler, and more deprecated API removal.
parent
f39532c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llwindow/llwindowmacosx.cpp
+2
-2
2 additions, 2 deletions
indra/llwindow/llwindowmacosx.cpp
indra/newview/llappviewermacosx.cpp
+114
-2
114 additions, 2 deletions
indra/newview/llappviewermacosx.cpp
with
116 additions
and
4 deletions
indra/llwindow/llwindowmacosx.cpp
+
2
−
2
View file @
bf1e9124
...
...
@@ -1350,7 +1350,7 @@ void LLWindowMacOSX::updateCursor()
{
default:
case
UI_CURSOR_ARROW
:
Init
Cursor
();
setArrow
Cursor
();
if
(
mCursorHidden
)
{
// Since InitCursor resets the hide level, correct for it here.
...
...
@@ -1410,7 +1410,7 @@ void LLWindowMacOSX::updateCursor()
if
(
result
!=
noErr
)
{
Init
Cursor
();
setArrow
Cursor
();
}
mCurrentCursor
=
mNextCursor
;
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llappviewermacosx.cpp
+
114
−
2
View file @
bf1e9124
...
...
@@ -30,6 +30,8 @@
#error "Use only with Mac OS X"
#endif
#define LL_CARBON_CRASH_HANDLER 1
#include
"llappviewermacosx.h"
#include
"llwindowmacosx-objc.h"
#include
"llcommandlineparser.h"
...
...
@@ -40,6 +42,9 @@
#include
"llfloaterworldmap.h"
#include
"llurldispatcher.h"
#include
<ApplicationServices/ApplicationServices.h>
#ifdef LL_CARBON_CRASH_HANDLER
#include
<Carbon/Carbon.h>
#endif
#include
"lldir.h"
#include
<signal.h>
#include
<CoreAudio/CoreAudio.h>
// for systemwide mute
...
...
@@ -51,8 +56,18 @@ namespace
// They are not used immediately by the app.
int
gArgC
;
char
**
gArgV
;
bool
sCrashReporterIsRunning
=
false
;
LLAppViewerMacOSX
*
gViewerAppPtr
;
#ifdef LL_CARBON_CRASH_HANDLER
OSErr
AEQuitHandler
(
const
AppleEvent
*
messagein
,
AppleEvent
*
reply
,
long
refIn
)
{
OSErr
result
=
noErr
;
LLAppViewer
::
instance
()
->
userQuit
();
return
(
result
);
}
#endif
}
bool
initViewer
()
...
...
@@ -263,9 +278,39 @@ bool LLAppViewerMacOSX::restoreErrorTrap()
return
reset_count
==
0
;
}
#ifdef LL_CARBON_CRASH_HANDLER
static
OSStatus
CarbonEventHandler
(
EventHandlerCallRef
inHandlerCallRef
,
EventRef
inEvent
,
void
*
inUserData
)
{
ProcessSerialNumber
psn
;
GetEventParameter
(
inEvent
,
kEventParamProcessID
,
typeProcessSerialNumber
,
NULL
,
sizeof
(
psn
),
NULL
,
&
psn
);
if
(
GetEventKind
(
inEvent
)
==
kEventAppTerminated
)
{
Boolean
matching_psn
=
FALSE
;
OSErr
os_result
=
SameProcess
(
&
psn
,
(
ProcessSerialNumber
*
)
inUserData
,
&
matching_psn
);
if
(
os_result
>=
0
&&
matching_psn
)
{
sCrashReporterIsRunning
=
false
;
QuitApplicationEventLoop
();
}
}
return
noErr
;
}
#endif
void
LLAppViewerMacOSX
::
handleCrashReporting
(
bool
reportFreeze
)
{
// This used to use fork&exec, but is switched to LSOpenApplication to
#ifdef LL_CARBON_CRASH_HANDLER
// This used to use fork&exec, but is switched to LSOpenApplication to
// Make sure the crash reporter launches in front of the SL window.
std
::
string
command_str
;
...
...
@@ -283,8 +328,75 @@ void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze)
memset
(
&
appParams
,
0
,
sizeof
(
appParams
));
appParams
.
version
=
0
;
appParams
.
flags
=
kLSLaunchNoParams
|
kLSLaunchStartClassic
;
appParams
.
application
=
&
appRef
;
if
(
reportFreeze
)
{
// Make sure freeze reporting launches the crash logger synchronously, lest
// Log files get changed by SL while the logger is running.
// *NOTE:Mani A better way - make a copy of the data that the crash reporter will send
// and let SL go about its business. This way makes the mac work like windows and linux
// and is the smallest patch for the issue.
sCrashReporterIsRunning
=
false
;
ProcessSerialNumber
o_psn
;
static
EventHandlerRef
sCarbonEventsRef
=
NULL
;
static
const
EventTypeSpec
kEvents
[]
=
{
{
kEventClassApplication
,
kEventAppTerminated
}
};
// Install the handler to detect crash logger termination
InstallEventHandler
(
GetApplicationEventTarget
(),
(
EventHandlerUPP
)
CarbonEventHandler
,
GetEventTypeCount
(
kEvents
),
kEvents
,
&
o_psn
,
&
sCarbonEventsRef
);
// Remove, temporarily the quit handler - which has *crash* behavior before
// the mainloop gets running!
AERemoveEventHandler
(
kCoreEventClass
,
kAEQuitApplication
,
NewAEEventHandlerUPP
(
AEQuitHandler
),
false
);
// Launch the crash reporter.
os_result
=
LSOpenApplication
(
&
appParams
,
&
o_psn
);
if
(
os_result
>=
0
)
{
sCrashReporterIsRunning
=
true
;
}
while
(
sCrashReporterIsRunning
)
{
RunApplicationEventLoop
();
}
// Re-install the apps quit handler.
AEInstallEventHandler
(
kCoreEventClass
,
kAEQuitApplication
,
NewAEEventHandlerUPP
(
AEQuitHandler
),
0
,
false
);
// Remove the crash reporter quit handler.
RemoveEventHandler
(
sCarbonEventsRef
);
}
else
{
appParams
.
flags
|=
kLSLaunchAsync
;
clear_signals
();
ProcessSerialNumber
o_psn
;
os_result
=
LSOpenApplication
(
&
appParams
,
&
o_psn
);
}
}
#endif
}
std
::
string
LLAppViewerMacOSX
::
generateSerialNumber
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment