# \[UE 4.7\]: Editor Plugin crash with SetTimer.

**URL:** <https://forums.unrealengine.com/t/ue-4-7-editor-plugin-crash-with-settimer/311222>\
**Category:** Plugins\
**Tags:** unreal-engine, crash, editor, Plugins, UE4, CPP, question\
**Created:** [March 16, 2015, 3:59pm UTC](https://forums.unrealengine.com/t/ue-4-7-editor-plugin-crash-with-settimer/311222 "2015-03-16T15:59:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RoadStar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RoadStar](https://forums.unrealengine.com/u/RoadStar)\
**Post date:** [March 16, 2015, 3:59pm UTC](https://forums.unrealengine.com/t/ue-4-7-editor-plugin-crash-with-settimer/311222/1 "2015-03-16T15:59:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![SlimeQ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SlimeQ](https://forums.unrealengine.com/u/SlimeQ)\
**Post date:** [July 3, 2017, 5:05pm UTC](https://forums.unrealengine.com/t/ue-4-7-editor-plugin-crash-with-settimer/311222/2 "2017-07-03T17:05:33Z")

</div>

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