Skip to content

Commit

Permalink
Fix memory leak in Path.Destroy native
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenzzer committed Mar 2, 2024
1 parent 0598845 commit 11a3b2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion extension/natives/nextbot/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#include "path/chase.hpp"
#include "path/follower.hpp"

#include "NextBotChasePath.h"
#include "NextBotPathFollow.h"

namespace natives::nextbot::path {

SMPathFollowerCost::SMPathFollowerCost(INextBot* bot, IPluginFunction* func) : m_pFunc(func), m_bot(bot)
Expand Down Expand Up @@ -594,7 +597,7 @@ cell_t ComputeToTarget(IPluginContext* context, const cell_t* params) {

cell_t Destroy(IPluginContext* context, const cell_t* params) {
auto path = Get<Path>(context, params[1]);
if (path) {
if (!path) {
return 0;
}

Expand Down

0 comments on commit 11a3b2a

Please sign in to comment.