x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[UE 4.7]: Editor Plugin crash with SetTimer.

I'm using very simple SetTime in my installed Editor Plugin.

VS building well, but Editor is crashing in approx 73% of load.

That what I see in VS Output:

 ...
 'UE4Editor.exe' (Win32): Loaded 'C:\Program Files\Epic Games\4.7\Engine\Plugins\ScriptPlugin\Binaries\Win64\UE4Editor-ScriptEditorPlugin.dll'. Symbols loaded.
 'UE4Editor.exe' (Win32): Loaded 'C:\Program Files\Epic Games\4.7\Engine\Plugins\Slate\SlateRemote\Binaries\Win64\UE4Editor-SlateRemote.dll'. Symbols loaded.
 'UE4Editor.exe' (Win32): Loaded 'C:\Users\vyudin\Documents\Unreal Projects\timers\Plugins\timerPlugin\Binaries\Win64\UE4Editor-timerPlugin.dll'. Symbols loaded.
 [2015.03.16-15.19.09:537][  0]ModuleLog:Warning: *** Hi from Timer Plugin! ***
 First-chance exception at 0x000007FEE6D00716 (UE4Editor-UnrealEd.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0x0000000000000FA0.
 Unhandled exception at 0x000007FEE6D00716 (UE4Editor-UnrealEd.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0x0000000000000FA0.
 ...

My VS pointing on line 616 of SharedPointer.h from Engine Source, on this code:

     // NOTE: The following is an Unreal extension to standard shared_ptr behavior
     FORCEINLINE TSharedRef< ObjectType, Mode > ToSharedRef() const
     {
          // If this assert goes off, it means a shared reference was created from a shared pointer that was nullptr.
          // Shared references are never allowed to be null.  Consider using TSharedPtr instead.
         check( IsValid() );
         return TSharedRef< ObjectType, Mode >( *this );
     }


Please find attached source code of my plugin. Can you advise my please how to avoid crashing? Thank you in advance!

My .cpp file:

 #include "timerPluginPch.h"
 #include "Module.h"
 #include "LevelEditor.h"
 #include "UnrealEd.h"
 
 IMPLEMENT_MODULE(Module, timerPlugin);
 DEFINE_LOG_CATEGORY(ModuleLog)
 
 Module::Module()
 {
 }
 
 void Module::StartupModule()
 {
     UE_LOG(ModuleLog, Warning, TEXT("*** Hi from Timer Plugin! ***"));
 
     float Seconds = (float)FTimespan::FromMinutes(0.1).GetTotalSeconds();
     FTimerDelegate Delegate;
     Delegate.BindRaw(this, &Module::Ticker);
 
     GEditor->GetTimerManager()->SetTimer(TimerHandle_Ticker, Delegate, Seconds, true);
 }
 
 void Module::ShutdownModule()
 {
 }
 
 void Module::Ticker()
 {
     UE_LOG(ModuleLog, Warning, TEXT("--- T I C K ---"));
 }

My header:

 #pragma once
 
 DECLARE_LOG_CATEGORY_EXTERN(ModuleLog, Log, All)
 
 class Module : public IModuleInterface
 {
 public:
     Module();
 
     virtual void StartupModule() override;
     virtual void ShutdownModule() override;
 
 private:
     FTimerHandle TimerHandle_Ticker;
     void Ticker();
 };

plugin source code

Product Version: Not Selected
Tags:
timerplugin.zip (2.8 kB)
more ▼

asked Mar 16 '15 at 03:59 PM in C++ Programming

avatar image

RoadStar
13 1 3 7

avatar image SlimeQ Jul 03 '17 at 05:05 PM

did you ever figure this out? i'm having the same issue in 4.16

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question