Merge branch 'release/2025.03' of https://github.com/secondlife/viewer

master
Ansariel 2025-04-03 23:08:03 +02:00
commit 1243de5d84
8 changed files with 96 additions and 23 deletions

View File

@ -183,12 +183,12 @@ void LL::WorkQueueBase::callWork(const Work& work)
catch (...)
{
// Stash any other kind of uncaught exception to be rethrown by main thread.
LL_WARNS("LLCoros") << "Capturing uncaught exception in WorkQueueBase "
LL_WARNS("LLCoros") << "Capturing and rethrowing uncaught exception in WorkQueueBase "
<< getKey() << LL_ENDL;
LL::WorkQueue::ptr_t main_queue = LL::WorkQueue::getInstance("mainloop");
main_queue->post(
// Bind the current exception rethrow it in main loop.
// Bind the current exception, rethrow it in main loop.
[exc = std::current_exception()]() { std::rethrow_exception(exc); });
}
#endif // else LL_WINDOWS

View File

@ -5635,14 +5635,22 @@ struct MikktData
{
U32 count = face->mNumIndices;
p.resize(count);
n.resize(count);
tc.resize(count);
t.resize(count);
if (face->mWeights)
try
{
w.resize(count);
p.resize(count);
n.resize(count);
tc.resize(count);
t.resize(count);
if (face->mWeights)
{
w.resize(count);
}
}
catch (std::bad_alloc&)
{
LLError::LLUserWarningMsg::showOutOfMemory();
LL_ERRS("LLCoros") << "Bad memory allocation in MikktData, elements count: " << count << LL_ENDL;
}
@ -5714,7 +5722,16 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
// and is executed on a background thread
MikktData data(this);
mikk::Mikktspace ctx(data);
ctx.genTangSpace();
try
{
ctx.genTangSpace();
}
catch (std::bad_alloc&)
{
LLError::LLUserWarningMsg::showOutOfMemory();
LL_ERRS("LLCoros") << "Bad memory allocation in MikktData::genTangSpace" << LL_ENDL;
}
//re-weld
meshopt_Stream mos[] =
@ -5727,7 +5744,15 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
};
std::vector<U32> remap;
remap.resize(data.p.size());
try
{
remap.resize(data.p.size());
}
catch (std::bad_alloc&)
{
LLError::LLUserWarningMsg::showOutOfMemory();
LL_ERRS("LLCoros") << "Failed to allocate memory for remap: " << (S32)data.p.size() << LL_ENDL;
}
U32 stream_count = data.w.empty() ? 4 : 5;

View File

@ -174,12 +174,14 @@ bool LLCommandManager::load()
if (!parser.readXUI(commands_file, commandsParams))
{
LLError::LLUserWarningMsg::showMissingFiles();
LL_ERRS() << "Unable to load xml file: " << commands_file << LL_ENDL;
return false;
}
if (!commandsParams.validateBlock())
{
LLError::LLUserWarningMsg::showMissingFiles();
LL_ERRS() << "Invalid commands file: " << commands_file << LL_ENDL;
return false;
}

View File

@ -615,6 +615,13 @@ void LLNotification::cancel()
LLSD LLNotification::getResponseTemplate(EResponseTemplateType type)
{
LLSD response = LLSD::emptyMap();
if (!mForm)
{
LL_WARNS("Notifications") << "Null form when getting response template for notification " << getName() << LL_ENDL;
return response;
}
for (S32 element_idx = 0;
element_idx < mForm->getNumElements();
++element_idx)
@ -1257,10 +1264,26 @@ LLNotifications::LLNotifications()
LLInstanceTracker<LLNotificationChannel, std::string>::instanceCount();
}
LLNotifications::~LLNotifications()
{
// Clear explicitly, something in ~LLNotifications() crashes so narrowing down suspects
pHistoryChannel = nullptr;
pExpirationChannel = nullptr;
mGlobalStrings.clear();
mTemplates.clear();
mVisibilityRules.clear();
mUniqueNotifications.clear();
mListener = nullptr;
}
void LLNotifications::clear()
{
mDefaultChannels.clear();
mTemplates.clear();
// At this point mTemplates still gets used by lingering notifications
// to do responses (ex: group notice will call forceResponse()), but
// since network should be down and everything save, it's questionable
// whether it should stay that way
}
// The expiration channel gets all notifications that are cancelled
@ -1473,6 +1496,13 @@ bool LLNotifications::templateExists(std::string_view name)
void LLNotifications::forceResponse(const LLNotification::Params& params, S32 option)
{
LLNotificationPtr temp_notify(new LLNotification(params));
if (!temp_notify->getForm())
{
LL_WARNS("Notifications") << "Cannot force response for notification with null form: " << (std::string)params.name << LL_ENDL;
return;
}
LLSD response = temp_notify->getResponseTemplate();
LLSD selected_item = temp_notify->getForm()->getElement(option);

View File

@ -892,7 +892,7 @@ class LLNotifications :
{
LLSINGLETON(LLNotifications);
LOG_CLASS(LLNotifications);
virtual ~LLNotifications() {}
virtual ~LLNotifications();
public:

View File

@ -6130,15 +6130,28 @@ void LLAppViewer::sendLogoutRequest()
gLogoutInProgress = true;
if (!mSecondInstance)
{
mLogoutMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LOGOUT_MARKER_FILE_NAME);
mLogoutMarkerFile.open(mLogoutMarkerFileName, LL_APR_WB);
if (mLogoutMarkerFile.getFileHandle())
mLogoutMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LOGOUT_MARKER_FILE_NAME);
try
{
LL_INFOS("MarkerFile") << "Created logout marker file '"<< mLogoutMarkerFileName << "' " << LL_ENDL;
recordMarkerVersion(mLogoutMarkerFile);
if (!mLogoutMarkerFile.getFileHandle())
{
mLogoutMarkerFile.open(mLogoutMarkerFileName, LL_APR_WB);
if (mLogoutMarkerFile.getFileHandle())
{
LL_INFOS("MarkerFile") << "Created logout marker file '" << mLogoutMarkerFileName << "' " << LL_ENDL;
recordMarkerVersion(mLogoutMarkerFile);
}
else
{
LL_WARNS("MarkerFile") << "Cannot create logout marker file " << mLogoutMarkerFileName << LL_ENDL;
}
}
else
{
LL_WARNS("MarkerFile") << "Atempted to reopen file '" << mLogoutMarkerFileName << "' " << LL_ENDL;
}
}
else
catch (...)
{
LL_WARNS("MarkerFile") << "Cannot create logout marker file " << mLogoutMarkerFileName << LL_ENDL;
}

View File

@ -1546,7 +1546,7 @@ void LLViewerWindow::handleMouseLeave(LLWindow *window)
bool LLViewerWindow::handleCloseRequest(LLWindow *window)
{
if (!LLApp::isExiting())
if (!LLApp::isExiting() && !LLApp::isStopped())
{
// User has indicated they want to close, but we may need to ask
// about modified documents.

View File

@ -3026,7 +3026,7 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b
{
root["ug"] = user_gain;
}
if (root.size() > 0)
if (root.size() > 0 && mWebRTCDataInterface)
{
std::string json_data = boost::json::serialize(root);
mWebRTCDataInterface->sendData(json_data, false);
@ -3069,7 +3069,10 @@ void LLVoiceWebRTCConnection::OnDataChannelReady(llwebrtc::LLWebRTCDataInterface
void LLVoiceWebRTCConnection::sendJoin()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE;
if (!mWebRTCDataInterface)
{
return;
}
boost::json::object root;
boost::json::object join_obj;