mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-10-09 00:09:42 +00:00
no segfault through to subscribe
This commit is contained in:
@@ -14,7 +14,7 @@ AEventSourceActor::AEventSourceActor() :
|
||||
PrimaryActorTick.bCanEverTick = true;
|
||||
|
||||
//redis = NewObject<URedisObject>(this, TEXT("RedisObject"));
|
||||
redis = CreateDefaultSubobject<URedisObject>(TEXT("RedisObject"));
|
||||
//redis = CreateDefaultSubobject<URedisObject>(TEXT("RedisObject"));
|
||||
|
||||
//RootComponent = redis;
|
||||
}
|
||||
@@ -63,11 +63,11 @@ void AEventSourceActor::Tick(float DeltaTime)
|
||||
void AEventSourceActor::ConstructClient()
|
||||
{
|
||||
if (redis != nullptr) {
|
||||
UE_LOG(EventSourceLog, Log, TEXT("Construct(): Redis is NOT null"));
|
||||
UE_LOG(EventSourceLog, Log, TEXT("Construct2(): Redis is NOT null"));
|
||||
return;
|
||||
}
|
||||
|
||||
UE_LOG(EventSourceLog, Log, TEXT("construct(): redis = new Redis()"));
|
||||
UE_LOG(EventSourceLog, Log, TEXT("construct2(): redis = new Redis()"));
|
||||
redis = NewObject<URedisObject>(this, TEXT("RedisObject"));
|
||||
}
|
||||
|
||||
@@ -75,24 +75,24 @@ void AEventSourceActor::ConstructClient()
|
||||
void AEventSourceActor::Init()
|
||||
{
|
||||
if (redis == nullptr) {
|
||||
UE_LOG(EventSourceLog, Log, TEXT("Init(): Redis is null"));
|
||||
UE_LOG(EventSourceLog, Log, TEXT("Init2(): Redis is null"));
|
||||
return;
|
||||
}
|
||||
|
||||
UE_LOG(EventSourceLog, Log, TEXT("construct(): redis = new Redis()"));
|
||||
redis = NewObject<URedisObject>(this, TEXT("RedisObject"));
|
||||
UE_LOG(EventSourceLog, Log, TEXT("Init(): redis->Init()"));
|
||||
//UE_LOG(EventSourceLog, Log, TEXT("construct(): redis = new Redis()"));
|
||||
//redis = NewObject<URedisObject>(this, TEXT("RedisObject"));
|
||||
UE_LOG(EventSourceLog, Log, TEXT("Init2(): redis->Init()"));
|
||||
redis->Init(redisHost, redisPort, redisPassword);
|
||||
}
|
||||
|
||||
void AEventSourceActor::Subscribe(const FString& Channel)
|
||||
{
|
||||
if (redis == nullptr) {
|
||||
UE_LOG(EventSourceLog, Log, TEXT("Subscribe(): Redis is null"));
|
||||
UE_LOG(EventSourceLog, Log, TEXT("Subscribe2(): Redis is null"));
|
||||
return;
|
||||
}
|
||||
|
||||
UE_LOG(EventSourceLog, Log, TEXT("Subscribe(): redis->Subscribe()"));
|
||||
UE_LOG(EventSourceLog, Log, TEXT("Subscribe2(): redis->Subscribe()"));
|
||||
redis->Subscribe(Channel);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user