Commit Graph

564 Commits (bd008a170898e69beeb8bc0481b4bfd94de86c55)

Author SHA1 Message Date
Nat Goodspeed a851a0c130 DRTVWR-494: Avoid keeping iterator to destroyed temporary container. 2019-12-18 12:27:05 -05:00
Nat Goodspeed 24499ac66f Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2019-12-13 12:30:03 -05:00
Nat Goodspeed b2913b7cf1 DRTVWR-494: Defend LLInstanceTracker against multi-thread usage.
The previous implementation went to some effort to crash if anyone attempted
to create or destroy an LLInstanceTracker subclass instance during traversal.
That restriction is manageable within a single thread, but becomes unworkable
if it's possible that a given subclass might be used on more than one thread.

Remove LLInstanceTracker::instance_iter, beginInstances(), endInstances(),
also key_iter, beginKeys() and endKeys(). Instead, introduce key_snapshot()
and instance_snapshot(), the only means of iterating over LLInstanceTracker
instances. (These are intended to resemble functions, but in fact the current
implementation simply presents the classes.) Iterating over a captured
snapshot defends against container modifications during traversal. The term
'snapshot' reminds the coder that a new instance created during traversal will
not be considered. To defend against instance deletion during traversal, a
snapshot stores std::weak_ptrs which it lazily dereferences, skipping on the
fly any that have expired.

Dereferencing instance_snapshot::iterator gets you a reference rather than a
pointer. Because some use cases want to delete all existing instances, add an
instance_snapshot::deleteAll() method that extracts the pointer. Those cases
used to require explicitly copying instance pointers into a separate
container; instance_snapshot() now takes care of that. It remains the caller's
responsibility to ensure that all instances of that LLInstanceTracker subclass
were allocated on the heap.

Replace unkeyed static LLInstanceTracker::getInstance(T*) -- which returned
nullptr if that instance had been destroyed -- with new getWeak() method
returning std::weak_ptr<T>. Caller must detect expiration of that weak_ptr.

Adjust tests accordingly.

Use of std::weak_ptr to detect expired instances requires engaging
std::shared_ptr in the constructor. We now store shared_ptrs in the static
containers (std::map for keyed, std::set for unkeyed).

Make LLInstanceTrackerBase a template parameterized on the type of the static
data it manages. For that reason, hoist static data class declarations out of
the class definitions to an LLInstanceTrackerStuff namespace.

Remove the static atomic sIterationNestDepth and its methods incrementDepth(),
decrementDepth() and getDepth(), since they were used only to forbid creation
and destruction during traversal.

Add a std::mutex to static data. Introduce an internal LockStatic class that
locks the mutex while providing a pointer to static data, making that the only
way to access the static data.

The LLINSTANCETRACKER_DTOR_NOEXCEPT macro goes away because we no longer
expect ~LLInstanceTracker() to throw an exception in test programs.
That affects LLTrace::StatBase as well as LLInstanceTracker itself.

Adapt consumers to the new LLInstanceTracker API.
2019-12-02 14:39:24 -05:00
AndreyL ProductEngine fe490d52b4 Merged in lindenlab/viewer-xcode11 2019-10-09 19:28:30 +03:00
Nat Goodspeed 52c9f57819 DRTVWR-476: Track change to NSView in Xcode 11's 10.15 SDK. 2019-09-25 16:48:36 -04:00
AndreyL ProductEngine cdcdc4b3e3 Merged in lindenlab/viewer-bear 2019-08-13 21:59:37 +03:00
AndreyL ProductEngine 823cef92ed Merged in lindenlab/viewer-lynx 2019-08-13 21:58:10 +03:00
AndreyL ProductEngine ef423bfb81 Merged in lindenlab/viewer-release 2019-08-13 21:54:23 +03:00
Mnikolenko ProductEngine c5bcb31d00 SL-11592 [Mac] Fixed mouse buttons ids for correct handling. 2019-07-19 13:40:17 +03:00
andreykproductengine a0bf70b41d SL-11592 [Mac] Ability to bind extra mouse buttons for push to talk 2019-07-18 19:18:02 +03:00
andreykproductengine ba2429163a SL-11592 [Win] Ability to bind extra mouse buttons for push to talk 2019-07-18 18:37:45 +03:00
AndreyL ProductEngine 293d186190 Merged in lindenlab/viewer-release 2019-06-24 20:10:14 +03:00
AndreyL ProductEngine ad64edd9c0 Merged in lindenlab/viewer-lynx 2019-06-22 03:17:43 +03:00
AndreyL ProductEngine 13580377c4 Merged in lindenlab/viewer-release 2019-06-22 03:16:39 +03:00
Mnikolenko ProductEngine b813814202 SL-11432 FIXED [OSX] Avatar is spinning when pressing Alt+D+Command and then releasing D key 2019-06-20 15:41:27 +03:00
AndreyL ProductEngine 9212c1f33e SL-11341 Skip storing the previous gamma value on Intel GPUs + more logging 2019-06-04 00:03:03 +03:00
Mnikolenko ProductEngine 77ba332880 SL-11178 FIXED [mac] Viewer crashes if another app gets focus before viewer window is created 2019-05-16 12:14:07 +03:00
AndreyL ProductEngine aefb0503aa Merged in lindenlab/viewer-release 2019-05-08 00:09:53 +03:00
AndreyL ProductEngine db6d4a3cb4 SL-10888 Fixed OSX mouse issues in HiDPI mode 2019-04-15 20:26:13 +03:00
andreykproductengine 19cae5d2cc SL-10907 getWidthF32 crash in fonts 2019-04-08 18:53:47 +03:00
AndreyL ProductEngine 1470e82c89 Merged in lindenlab/viewer-release 2019-04-02 21:51:54 +03:00
AndreyL ProductEngine 5715cda6e0 Merged in lindenlab/viewer-release 2019-03-01 10:55:47 +02:00
AndreyL ProductEngine 36cb6933e6 Merged in lindenlab/viewer-release 2019-03-01 02:24:00 +02:00
Drake Arconis 6308743fd2 Fix issue where gamma was being corrupted on windows with night light enabled 2019-02-08 19:26:28 -08:00
Andrey Lihatskiy 942a37d969 Merged in ruslantproductengine/viewer-cougar-4cr-5 (pull request #41)
SL-10176  - [Love Me Render] MacOS Quit / Shutdown crash

Approved-by: Andrey Lihatskiy <andreylproductengine@lindenlab.com>
2019-01-14 23:27:05 +00:00
ruslantproductengine f6bccd6f9e - remove getDeviceScaleFactor() and replace it to getSystemUISize() according Ansariel note 2019-01-14 19:07:00 +02:00
Nat Goodspeed 02b9ac8d9a SL-10153: Fix OSMessageBoxWin32() to handle non-ASCII text. 2018-12-11 20:51:51 -05:00
ruslantproductengine 6c8cfff7ab SL-10176 - [Love Me Render] MacOS Quit / Shutdown crash 2018-12-11 18:11:58 +02:00
ruslantproductengine acc86a9139 SL-9766 [Render] [Mac] Alt + left mouse click has severely impaired functions
SL-10019 - [Mac] [Render] Right-click context menu immediately disappears when clicking any place in the ‘Inventory’ floater
SL-9984 - [Retina] Camera frustum, do not display correctly on "WORLD MAP" window.
SL-10027 - [Mac] [Render] Add toggle for Retina support to mitigate FPS loss

Re-FIX for Retina support.
2018-11-26 18:02:44 +02:00
ruslantproductengine eaeb8605d0 SL-9774 [Render] dragging active Second Life session to second monitor zooms in making viewer unusable 2018-10-23 19:24:03 +03:00
ruslantproductengine 6ce18422de SL-9766 [Render] [Mac] Alt + left mouse click has severely impaired functions 2018-10-19 19:12:08 +03:00
AndreyL ProductEngine 892d3a9bf8 Merged in lindenlab/viewer-release 2018-09-27 13:04:12 +03:00
Nat Goodspeed 82bdb300fe Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2018-09-26 16:32:15 -04:00
Nat Goodspeed 289813994e DRTVWR-474: Clean up use of LLDir::getAppRODataDir(), esp. on Mac.
Clearly it's not obvious to maintainers that on the Mac, getAppRODataDir()
returns the app's Resources directory: in a number of places the code starts
with the executable directory and appends "../Resources" to find that.
2018-09-13 16:20:05 -04:00
andreykproductengine 94eeef729e MAINT-9082 crash on HandleFocusLost 2018-09-04 20:19:48 +03:00
ruslantproductengine 20a2019e4b MAINT-9076 Improved support for Retina Displays 2018-09-03 17:22:15 +03:00
Nat Goodspeed 0d596aa4de Automated merge with file:///Users/nat/linden/viewer-gridselect 2019-04-26 11:17:53 -04:00
Nat Goodspeed 468fbd6b51 Return CGPoint and CGSize by value, not const ref to temporary. 2019-04-25 15:11:55 -04:00
AndreyL ProductEngine 30b864e6d4 Merged in lindenlab/viewer-bear 2019-04-16 19:48:11 +03:00
AndreyL ProductEngine 65bf63c973 Merged in lindenlab/viewer-bear 2019-04-02 22:12:55 +03:00
andreykproductengine ec9a70de94 SL-10648 Handling for Window crash on exit 2019-03-21 18:58:11 +02:00
andreykproductengine 9f16d10f6d MAINT-5651 Crashes on close from LLWindowWin32 2018-08-14 18:32:59 +03:00
Andrey Kleshchev 18bb3f6b86 MAINT-8712 Crash on close in LLWindowWin32 2018-06-01 13:51:03 +00:00
Mnikolenko ProductEngine cd3608e661 SL-10023 FIXED Dragging mouse on World map sometimes causes cursor jump to the center of the screen 2018-11-16 15:53:52 +02:00
Mnikolenko ProductEngine 536a99c7ae MAINT-8428 FIXED [OSX] The 'Eyedropper' cursor is not shown in the world 2018-03-26 17:42:57 +03:00
Graham Linden graham@lindenlab.com 06bce2ddd0 Add debug setting and code to allow nVidia nSight graphics debugging to capture SL frames.
These changes are only enabled if RenderNsightDebugSupport is true and eliminate use of
some OpenGL legacy functionality which is incompatible with nSight capture
(mostly glReadPixels and other fixed-function pipe rendering calls).
2018-02-15 21:55:24 +00:00
andreykproductengine 3b73cec39e Build fix for non-dpi aware environment 2018-01-19 19:42:57 +02:00
andreykproductengine af3bf74eea MAINT-8183 Additional logging 2018-01-17 18:46:56 +02:00
AndreyL ProductEngine 57a99273ed Merged in lindenlab/viewer-release 2018-01-17 03:20:12 +02:00
Ansariel f1c76a376c STORM-2151: Respect "Hide cursor while typing" user setting on Windows 2017-10-16 10:41:45 +02:00