# Steam callback c++ occuring twice.

**URL:** <https://forums.unrealengine.com/t/steam-callback-c-occuring-twice/439685>\
**Category:** Platform & Builds\
**Tags:** steamworks, unreal-engine, question, CPP\
**Created:** [December 17, 2018, 11:27pm UTC](https://forums.unrealengine.com/t/steam-callback-c-occuring-twice/439685 "2018-12-17T23:27:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Theopathy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Theopathy](https://forums.unrealengine.com/u/Theopathy)\
**Post date:** [December 17, 2018, 11:27pm UTC](https://forums.unrealengine.com/t/steam-callback-c-occuring-twice/439685/1 "2018-12-17T23:27:53Z")

</div>

I have set up steam and everything works correctly apart that a callback is being triggered twice. I am not calling “SteamAPI\_RunCallbacks” anywhere in my code.

---

<div class="post-metadata">

**Author:** ![narthur157](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@narthur157](https://forums.unrealengine.com/u/narthur157)\
**Post date:** [December 17, 2018, 11:33pm UTC](https://forums.unrealengine.com/t/steam-callback-c-occuring-twice/439685/2 "2018-12-17T23:33:59Z")

</div>

You’ll need to provide more information, and some code where this is ocurring

---

<div class="post-metadata">

**Author:** ![muoz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@muoz](https://forums.unrealengine.com/u/muoz)\
**Post date:** [April 14, 2021, 11:32am UTC](https://forums.unrealengine.com/t/steam-callback-c-occuring-twice/439685/3 "2021-04-14T11:32:37Z")

</div>

I have the same problem. Steam overlay callback is triggering twice in my project.

Header SteamCallbacks.h:

```
class GAMELIFTSTEAM_API SteamCallbacks
{
public:
	SteamCallbacks();
	~SteamCallbacks();

private:
	STEAM_CALLBACK(SteamCallbacks, OnSteamOverlayActivated, GameOverlayActivated_t);

```

Implementation SteamCallbacks.cpp:

```
void SteamCallbacks::OnSteamOverlayActivated(GameOverlayActivated_t* pCallback)
{
	if (pCallback->m_bActive)
	{
		UE_LOG(LogTemp, Warning, TEXT("Steam overlay now active."));
	}
	else
	{
		UE_LOG(LogTemp, Warning, TEXT("Steam overlay now inactive."));
	}
}
```

---

<div class="post-metadata">

**Author:** ![KevinDuguay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KevinDuguay](https://forums.unrealengine.com/u/KevinDuguay)\
**Post date:** [March 7, 2023, 7:42pm UTC](https://forums.unrealengine.com/t/steam-callback-c-occuring-twice/439685/4 "2023-03-07T19:42:15Z")

</div>

This might help:

> [@STEAM\_CALLBACK\_MANUAL being deleted by Garbage Collection](https://forums.unrealengine.com/t/steam_callback_manual-being-deleted-by-garbage-collection/475272):
>
> I’m implementing some Steam API callbacks, manually because the automated STEAM\_CALLBACK is triggering twice. The STEAM\_CALLBACK\_MANUAL is only calling once when registering a function, but it is removed after about 30 seconds by GC. I tried putting in a wrapper class, same results. In the functions, the logout shows it is firing until it is deleted. I tried SharedPtr as well without using the macro. I just need to know how to prevent Declaration and assignment code: SteamworksGIS.h STEAM\_CA…

Use STEAM\_CALLBACK\_MANUAL instead
