Commit Graph

24 Commits

Author SHA1 Message Date
Andrew Rodham
4f50114b65 Fixed vulnerability when destructing a FFeedbackContext that had outstanding slow tasks
The issue here is that the derived destructor for FFeedbackContextEditor would destroy it's TWeakPtr<SWindow>, proceeded by the destruction of any remaining FScopedSlowTasks held in the LegacyAPIScopes array. This destruction may have caused FFeedbackContextEditor::FinalizeSlowTask to be called which could have resulted in the TWeakPtr being used after its RefereceCount was deleted, causing a memory overwrite. I can't see any code in the wild which could have caused this, but I've also added some additional safety checks to catch error conditions earlier.

[CL 2605382 by Andrew Rodham in Main branch]
2015-06-30 06:30:06 -04:00
Robert Manuszewski
17911361b1 Adding guards to linker deletion so that nothing else can delete them except FLinkerManager.
Moved DeleteLoaders() declaration to Linker.h

[CL 2589184 by Robert Manuszewski in Main branch]
2015-06-16 15:41:55 -04:00
Robert Manuszewski
65fb0ff95e Deferred linker load delete to fix potential crashes when code attempts to access linkers that have already been deleted earlier in the callstack
[CL 2589115 by Robert Manuszewski in Main branch]
2015-06-16 15:08:39 -04:00
Lina Halper
e3521d316e Fix progress update during build process.
#Code review: Andrew.Rodham, Matt.Kuhlenschmidt

[CL 2520972 by Lina Halper in Main branch]
2015-04-22 09:56:22 -04:00
Andrew Rodham
95f8041d39 Changed slow task widget scope stack pointer to be a weak pointer
This should hopefull alleviate any crashes caused by invalid pointers

This addresses UE-12075.

[CL 2520748 by Andrew Rodham in Main branch]
2015-04-22 05:08:28 -04:00
Matt Kuhlenschmidt
96427e13cc Fix crash due to reentrancy of the slate tick loop if a slow task window and a modal window are siblings. The slow task window could re-tick the modal window while it was being ticked
[CL 2508325 by Matt Kuhlenschmidt in Main branch]
2015-04-10 10:16:24 -04:00
Andrew Rodham
c16d19ece8 Slow task dialogs now only take focus if the application is currently active
This should prevent it from grabbing the foreground window when running in the background.
This addresses UE-10994.

[CL 2489113 by Andrew Rodham in Main branch]
2015-03-24 07:20:04 -04:00
Laurent Delayen
e586cd3a8f Dev to Main integration from CL #2446290
[CL 2456855 by Laurent Delayen in Main branch]
2015-02-23 15:58:14 -05:00
Andrew Rodham
0121dca972 Changed editor feedback contexts to always delete the progress window if it exists.
There was a potential vulnerability where a slow task widget would not get cleaned up resulting in it outliving the pointer to the scope stack. The context no longer holds a strong reference to the slow task widget in a bid to prevent it from outliving the data to which it is tied.

[CL 2455914 by Andrew Rodham in Main branch]
2015-02-23 05:15:38 -05:00
Matthew Griffin
d9e81759df [INTEGRATE] Change 2438293 by Mike.Fricker@MFRICKER_G3686_Alpha on 2015/02/09 12:03:10
Editor startup splash improvements
	- Splash screen now updates with loading activity more frequently
	- Cleaned up the game name and version text
	- Cleaned up loading activity animation look a bit
	- Removed 32-bit/64-bit from splash.  The editor is always 64-bit.
	- We now display the game name after the editor version

[CL 2446998 by Matthew Griffin in Main branch]
2015-02-16 09:08:31 -05:00
Ben Marsh
4a557ef8a3 [INTEGRATE] Change 2421951 by Andrew.Rodham@AndrewRodham_4.7 on 2015/01/28 06:47:27
Fixed slow tasks sometimes not updating their progress dialogs

	SlateTick was being throttled along with slow task progress updates

[CL 2425815 by Ben Marsh in Main branch]
2015-01-30 10:48:40 -05:00
Dan Hertzka
1ce19a5ffa Full rename of the Slate "active tick" system to "active timer"
[CL 2394301 by Dan Hertzka in Main branch]
2014-12-19 17:44:49 -05:00
Dan Hertzka
c042ddcb94 ---- Merging with SlateDev branch ----
Introduces the concept of "Active Ticking" to allow Slate to go to sleep when there is no need to update the UI.

While asleep, Slate will skip the Tick & Paint pass for that frame entirely.
- There are TWO ways to "wake" Slate and cause a Tick/Paint pass:
    1. Provide some sort of input (mouse movement, clicks, and key presses). Slate will always tick when the user is active.
        - Therefore, if the logic in a given widget's Tick is only relevant in response to user action, there is no need to register an active tick.
    2. Register an Active Tick. Currently this is an all-or-nothing situation, so if a single active tick needs to execute, all of Slate will be ticked.

- The purpose of an Active Tick is to allow a widget to "drive" Slate and guarantee a Tick/Paint pass in the absence of any user action.
    - Examples include animation, async operations that update periodically, progress updates, loading bars, etc.

- An empty active tick is registered for viewports when they are real-time, so game project widgets are unaffected by this change and should continue to work as before.

- An Active Tick is registered by creating an FWidgetActiveTickDelegate and passing it to SWidget::RegisterActiveTick()
    - There are THREE ways to unregister an active tick:
        1. Return EActiveTickReturnType::StopTicking from the active tick function
        2. Pass the FActiveTickHandle returned by RegisterActiveTick() to SWidget::UnregisterActiveTick()
        3. Destroy the widget responsible for the active tick

- Sleeping is currently disabled, can be enabled with Slate.AllowSlateToSleep cvar
- There is currently a little buffer time during which Slate continues to tick following any input. Long-term, this is planned to be removed.
    - The duration of the buffer can be adjusted using Slate.SleepBufferPostInput cvar (defaults to 1.0f)

- The FCurveSequence API has been updated to work with the active tick system
    - Playing a curve sequence now requires that you pass the widget being animated by the sequence
    - The active tick will automatically be registered on behalf of the widget and unregister when the sequence is complete
    - GetLerpLooping() has been removed. Instead, pass true as the second param to Play() to indicate that the animation will loop. This causes the active tick to be registered indefinitely until paused or jumped to the start/end.

[CL 2391669 by Dan Hertzka in Main branch]
2014-12-17 16:07:57 -05:00
Richard TalbotWatkin
7510a0ba0f Improved splash screen and initialization process.
[CL 2390837 by Richard TalbotWatkin in Main branch]
2014-12-17 02:15:23 -05:00
Andrew Rodham
2ccc94a2f3 Reinstated some code that updated the build progress dialog during status updates.
[CL 2383356 by Andrew Rodham in Main branch]
2014-12-10 09:03:29 -05:00
Ben Marsh
149375b14b Update copyright notices to 2015.
[CL 2379638 by Ben Marsh in Main branch]
2014-12-07 19:09:38 -05:00
Andrew Rodham
82d38fde59 Fixed slow task dialogs not being ticked correctly for the very first time they are opened
[CL 2363417 by Andrew Rodham in Main branch]
2014-11-18 10:49:51 -05:00
Andrew Rodham
4ad1b987fc Improved progress reporting in the editor
FScopedSlowTask has been refactored to better allow for nesting of slow operations. This allows us to cascade nested scopes and provide accurate feedback on slow tasks. FScopedSlowTasks now work together when nested inside sub functions. Break up long functions that contain calls to multiple nested FScopedSlowTasks with FScopedSlowTask::EnterProgressFrame().

Example Usage:
void DoSlowWork()
{
    FScopedSlowTask Progress(2.f, LOCTEXT("DoingSlowWork", "Doing Slow Work..."));
    // Optionally make this show a dialog if not already shown
    Progress.MakeDialog();

    // Indicate that we are entering a frame representing 1 unit of work
    Progress.EnterProgressFrame(1.f);

    // DoFirstThing() can follow a similar pattern of creating a scope divided into frames. These contribute to their parent's progress frame proportionately.
    DoFirstThing();

    Progress.EnterProgressFrame(1.f);
    DoSecondThing();
}

This addresses TTP#338602 - NEEDS REVIEW: Editor progress bars nearly always just show 100%, don't offer useful indication of progress

[CL 2322391 by Andrew Rodham in Main branch]
2014-10-08 04:42:34 -04:00
Andrew Brown
74f2129cd2 The cancel button now appears on the feedback dialog while autosaving.
#ttp 337654 - EDITOR: Pressing Escape does not stop autosave

#branch UE4

#note The underlying issue appears to be that Escape should no longer cancels slow tasksà At around CL#1892733 a dedicated (optional) æCancelÆ button was added which is meant to be shown when the user is allowed to cancel the task. Unfortunately, autosave occurs in a common place where itÆs not always appropriate to cancel, so enabling Cancel to occur on the slow task by default wasnÆt a viable option. To get around this I modified the slow task so that Cancel can be toggled on or off at any point during its existence, depending on the context of the task at hand.

#add Added new function to FFeedbackContext: EnableUserCancel, so the user can manually show/hide the cancel button at any point during a slow task û this is handy when dealing with multiple jobs not all of which support the ability to cancel.

#change Tidied up SSlowTaskWidget by removing duplicate code and modifying how OnCancelClickedDelegate is used.

#remove Removed æEscapeÆ message now that cancel button is present.

reviewed by Thomas.Sarkanen

[CL 2217501 by Andrew Brown in Main branch]
2014-07-15 04:34:00 -04:00
Mikolaj Sieluzycki
de6a6e0c8f Back out changelist 2121706
[CL 2121856 by Mikolaj Sieluzycki in Main branch]
2014-06-30 10:25:10 -04:00
Mikolaj Sieluzycki
1bb08f711a Remove superfluous headers, part 1 of n.
#codereview Robert.Manuszewski

[CL 2121706 by Mikolaj Sieluzycki in Main branch]
2014-06-30 06:39:08 -04:00
Barnabas McManners
fdd86b2ee6 Fixed a divide by 0 crash from the slow task dialog.
#TTP 338368 - EDITOR: CRASH: Div by zero in FFeedbackContextEditor::UpdateProgress() called from FSimplygonMeshReduction

#branch UE4

#proj Editor.UnrealEd

#change Defaulted the Saved and New Ratios to 0, then tested the divisors for > 0. Added an ensure onto the passed in devisors check, if the user is passing in 0 they should be notified as they are using the interface wrong.

#reviewedby Chris.Wood

[CL 2119580 by Barnabas McManners in Main branch]
2014-06-27 11:48:07 -04:00
Dmitry Rekman
1680bee101 More clang fixes.
Mostly initialization order issues, but also a missing virtual destructor.

[CL 2084972 by Dmitry Rekman in Main branch]
2014-05-29 17:00:14 -04:00
Tim Sweeney
324683ce78 Engine source (Main branch up to CL 2026164) 2014-03-14 14:13:41 -04:00