Go to file
Nat Goodspeed f7d2d40b30 DRTVWR-587: Fix LL::apply(function, LLSD array).
We define a specialization of LLSDParam<const char*> to support passing an
LLSD object to a const char* function parameter. Needless to remark, passing
object.asString().c_str() would be Bad: destroying the temporary std::string
returned by asString() would immediately invalidate the pointer returned by
its c_str(). But when you pass LLSDParam<const char*>(object) as the
parameter, that specialization itself stores the std::string so the c_str()
pointer remains valid as long as the LLSDParam object does.

Then there's LLSDParam<LLSD>, used when we don't have the parameter type
available to select the LLSDParam specialization. LLSDParam<LLSD> defines a
templated conversion operator T() that constructs an LLSDParam<T> to provide
the actual parameter value. So far, so good.

The trouble was with the implementation of LLSDParam<LLSD>: it constructed a
_temporary_ LLSDParam<T>, implicitly called its operator T() and immediately
destroyed it. Destroying LLSDParam<const char*> destroyed its stored string,
thus invalidating the c_str() pointer before the target function was entered.

Instead, make LLSDParam<LLSD>::operator T() capture each LLSDParam<T> it
constructs, extending its lifespan to the lifespan of the LLSDParam<LLSD>
instance. For this, derive each LLSDParam specialization from LLSDParamBase, a
trivial base class that simply establishes the virtual destructor. We can then
capture any specialization as a pointer to LLSDParamBase.

Also restore LazyEventAPI tests on Mac.
2023-10-29 11:56:17 -04:00
.github SL-18837: Build all branches on GitHub now. 2023-10-25 14:39:31 -04:00
doc Merge branch 'main' into DRTVWR-587-maint-V 2023-10-03 19:25:19 +03:00
etc SL-694 - stub support for ObjectAnimation message type 2017-05-30 22:03:43 +01:00
indra DRTVWR-587: Fix LL::apply(function, LLSD array). 2023-10-29 11:56:17 -04:00
scripts SL-20473 Add GenericStreamingMessage and dummy handler to suppress packet loss and log spam noise when visiting GLTF enabled regions. 2023-10-16 16:21:20 -05:00
.clang-format DRTVWR-497 tweak clang-format rules for argument packing 2020-08-24 13:52:57 -06:00
.gitignore Remove cygwin artifacts 2022-10-10 11:23:05 -07:00
.pre-commit-config.yaml SL-19541: Add basic coding standards check 2023-04-04 12:47:19 -07:00
BuildParams Merge branch 'SL-15742' into DRTVWR-527-maint 2021-12-16 00:58:44 +02:00
LICENSE Renamed LICENSE.txt to follow naming scheme of other repos 2022-11-18 17:10:03 -05:00
README.md Fix readme logo for dark theme sites 2022-11-18 06:22:43 -05:00
autobuild.xml Merge branch 'main' into DRTVWR-587-maint-V 2023-10-25 21:28:26 +03:00
build.sh SL-18837: build.sh shouldn't even check for an installer. 2023-10-04 19:40:46 -04:00
buildscripts_support_functions SL-18837: Get buildscripts_support_functions from sling-buildscripts 2023-06-28 16:58:32 -04:00

README.md

Second Life Logo

Second Life is a free 3D virtual world where users can create, connect and chat with others from around the world. This repository contains the source code for the official client.

Open Source

Second Life provides a huge variety of tools for expression, content creation, socialization and play. Its vibrancy is only possible because of input and contributions from its residents. The client codebase has been open source since 2007 and is available under the LGPL license. The Open Source Portal contains additional information about Linden Lab's open source history and projects.

Download

Most people use a pre-built viewer release to access Second Life. Windows and macOS builds are published on the official website. More experimental viewers, such as release candidates and project viewers, are detailed on the Alternate Viewers page.

Third Party Viewers

Third party maintained forks, which include Linux compatible builds, are indexed in the Third Party Viewer Directory.

Build Instructions

Windows

Mac

Linux

Contribute

Help make Second Life better! You can get involved with improvements by filing bugs, suggesting enhancements, submitting pull requests and more. See the open source portal for details.