Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package emptyepsilon for openSUSE:Factory 
checked in at 2025-01-14 16:23:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/emptyepsilon (Old)
 and      /work/SRC/openSUSE:Factory/.emptyepsilon.new.1881 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "emptyepsilon"

Tue Jan 14 16:23:51 2025 rev:4 rq:1237732 version:2024.12.08

Changes:
--------
--- /work/SRC/openSUSE:Factory/emptyepsilon/emptyepsilon.changes        
2024-09-16 17:44:17.848087501 +0200
+++ /work/SRC/openSUSE:Factory/.emptyepsilon.new.1881/emptyepsilon.changes      
2025-01-14 16:24:39.895020701 +0100
@@ -1,0 +2,9 @@
+Fri Jan 10 21:06:16 UTC 2025 - Dominik Heidler <[email protected]>
+
+- Version 2024.12.08
+  * Remove 'f' suffix from numbers in lua (#2164)
+  * Some minor de updates
+  * fix minor typo
+  * more minor de updates
+
+-------------------------------------------------------------------

Old:
----
  EmptyEpsilon-2024.08.09.tar.gz
  SeriousProton-2024.08.09.tar.gz

New:
----
  EmptyEpsilon-2024.12.08.tar.gz
  SeriousProton-2024.12.08.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ emptyepsilon.spec ++++++
--- /var/tmp/diff_new_pack.P84qjt/_old  2025-01-14 16:24:43.815184272 +0100
+++ /var/tmp/diff_new_pack.P84qjt/_new  2025-01-14 16:24:43.819184438 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package emptyepsilon
 #
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           emptyepsilon
-Version:        2024.08.09
+Version:        2024.12.08
 Release:        0
 Summary:        Open source spaceship bridge simulator
 License:        GPL-2.0-only
@@ -33,6 +33,7 @@
 BuildRequires:  SDL2-devel
 BuildRequires:  bsdtar
 BuildRequires:  cmake
+BuildRequires:  fdupes
 BuildRequires:  gcc
 BuildRequires:  gcc-c++
 BuildRequires:  glm-devel
@@ -91,14 +92,16 @@
 
 %install
 %cmake_install
+%fdupes %{buildroot}/%{_datadir}
 
 %files
 %doc README.md
 %{_bindir}/EmptyEpsilon
-%{_docdir}/emptyepsilon/
+%{_docdir}/emptyepsilon/script_reference.html
 %{_datadir}/emptyepsilon/
-%{_datadir}/applications/EmptyEpsilon.desktop
-%{_datadir}/icons/hicolor/1024x1024/apps/EmptyEpsilon.png
-%dir %{_datadir}/icons/hicolor/1024x1024/apps
-%dir %{_datadir}/icons/hicolor/1024x1024
+%{_datadir}/applications/io.github.daid.EmptyEpsilon.desktop
+%{_datadir}/icons/hicolor/512x512/apps/io.github.daid.EmptyEpsilon.png
+%{_datadir}/metainfo/io.github.daid.EmptyEpsilon.metainfo.xml
+%dir %{_datadir}/icons/hicolor/512x512/apps
+%dir %{_datadir}/icons/hicolor/512x512
 

++++++ EmptyEpsilon-2024.08.09.tar.gz -> EmptyEpsilon-2024.12.08.tar.gz ++++++
/work/SRC/openSUSE:Factory/emptyepsilon/EmptyEpsilon-2024.08.09.tar.gz 
/work/SRC/openSUSE:Factory/.emptyepsilon.new.1881/EmptyEpsilon-2024.12.08.tar.gz
 differ: char 30, line 1

++++++ SeriousProton-2024.08.09.tar.gz -> SeriousProton-2024.12.08.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SeriousProton-EE-2024.08.09/src/graphics/font.cpp 
new/SeriousProton-EE-2024.12.08/src/graphics/font.cpp
--- old/SeriousProton-EE-2024.08.09/src/graphics/font.cpp       2024-08-08 
09:44:40.000000000 +0200
+++ new/SeriousProton-EE-2024.12.08/src/graphics/font.cpp       2024-11-06 
12:15:14.000000000 +0100
@@ -68,7 +68,7 @@
         position.x += glyph.advance * size_scale;
         if ((flags & FlagLineWrap) && position.x > area_size.x)
         {
-            //Try to wrap the line by going back to the last space character 
and replace that with a newline.
+            //Try to wrap the line by going back to the last space character 
and replace that with a newline. If a '-' is found first, keep it and just add 
a newline.
             for(int n=static_cast<int>(result.data.size())-2; (n > 0) && 
(result.data[n].char_code != 0); n--)
             {
                 if (result.data[n].char_code == ' ')
@@ -79,6 +79,16 @@
                     position.x = 0.0f;
                     position.y += line_spacing;
                     break;
+                }
+                if (result.data[n].char_code == '-')
+                {
+                    index = result.data[n + 1].string_offset;
+                    result.data.resize(n + 1);
+                    result.data.push_back(result.data.back());
+                    result.data.back().char_code = 0;
+                    position.x = 0.0f;
+                    position.y += line_spacing;
+                    break;
                 }
             }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SeriousProton-EE-2024.08.09/src/graphics/renderTarget.cpp 
new/SeriousProton-EE-2024.12.08/src/graphics/renderTarget.cpp
--- old/SeriousProton-EE-2024.08.09/src/graphics/renderTarget.cpp       
2024-08-08 09:44:40.000000000 +0200
+++ new/SeriousProton-EE-2024.12.08/src/graphics/renderTarget.cpp       
2024-11-06 12:15:14.000000000 +0100
@@ -487,6 +487,14 @@
     {
         for(int y=0; y<tile_count.y; y++)
         {
+            if(vertex_data.size() >= std::numeric_limits<uint64_t>::max() - 4)
+            {
+                if (info.texture)
+                    finish(info.texture);
+                else
+                    finish();
+            }
+
             auto n = vertex_data.size();
             index_data.insert(index_data.end(), {
                 uint16_t(n + 0), uint16_t(n + 1), uint16_t(n + 2),
@@ -600,6 +608,9 @@
 
 void RenderTarget::fillRect(const sp::Rect& rect, glm::u8vec4 color)
 {
+    if (vertex_data.size() >= std::numeric_limits<uint16_t>::max() - 4U)
+        finish();
+
     auto n = vertex_data.size();
     index_data.insert(index_data.end(), {
         uint16_t(n + 0), uint16_t(n + 1), uint16_t(n + 2),
@@ -622,7 +633,7 @@
     glm::u8vec4 color)
 {
     auto info = getTextureInfo(texture);
-    if (info.texture)
+    if (info.texture || vertex_data.size() >= 
std::numeric_limits<uint16_t>::max() - 4U)
         finish();
     auto& uv_rect = info.uv_rect;
 
@@ -747,6 +758,9 @@
             p2 += rect.position;
             p3 += rect.position;
 
+            if (vertex_data.size() >= std::numeric_limits<uint16_t>::max() - 
4U)
+                finish();
+
             auto n = vertex_data.size();
             index_data.insert(index_data.end(), {
                 uint16_t(n + 0), uint16_t(n + 1), uint16_t(n + 2),
@@ -815,6 +829,9 @@
             glm::vec2 p2 = mat * glm::vec2{left, bottom} + center;
             glm::vec2 p3 = mat * glm::vec2{right, bottom} + center;
 
+            if (vertex_data.size() >= std::numeric_limits<uint16_t>::max() - 
4U)
+                finish();
+
             auto n = vertex_data.size();
             index_data.insert(index_data.end(), {
                 uint16_t(n + 0), uint16_t(n + 1), uint16_t(n + 2),
@@ -845,7 +862,7 @@
 void RenderTarget::drawStretchedH(sp::Rect rect, std::string_view texture, 
glm::u8vec4 color)
 {
     auto info = getTextureInfo(texture);
-    if (info.texture)
+    if (info.texture || vertex_data.size() >= 
std::numeric_limits<uint16_t>::max() - 8U)
         finish();
     auto& uv_rect = info.uv_rect;
 
@@ -894,7 +911,7 @@
 void RenderTarget::drawStretchedV(sp::Rect rect, std::string_view texture, 
glm::u8vec4 color)
 {
     auto info = getTextureInfo(texture);
-    if (info.texture)
+    if (info.texture || vertex_data.size() >= 
std::numeric_limits<uint16_t>::max() - 8U)
         finish();
     auto& uv_rect = info.uv_rect;
 
@@ -943,7 +960,7 @@
 void RenderTarget::drawStretchedHV(sp::Rect rect, float corner_size, 
std::string_view texture, glm::u8vec4 color)
 {
     auto info = getTextureInfo(texture);
-    if (info.texture)
+    if (info.texture || vertex_data.size() >= 
std::numeric_limits<uint16_t>::max() - 16U)
         finish();
     auto& uv_rect = info.uv_rect;
 
@@ -1035,7 +1052,7 @@
         return;
 
     auto info = getTextureInfo(texture);
-    if (info.texture)
+    if (info.texture || vertex_data.size() >= 
std::numeric_limits<uint16_t>::max() - 16U)
         finish();
     const auto& uv_rect = info.uv_rect;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SeriousProton-EE-2024.08.09/src/io/keybinding.h 
new/SeriousProton-EE-2024.12.08/src/io/keybinding.h
--- old/SeriousProton-EE-2024.08.09/src/io/keybinding.h 2024-08-08 
09:44:40.000000000 +0200
+++ new/SeriousProton-EE-2024.12.08/src/io/keybinding.h 2024-11-06 
12:15:14.000000000 +0100
@@ -121,7 +121,7 @@
     static void updateKeys(int key_number, float value);
     
     static Keybinding* keybindings;
-    Keybinding* next;
+    Keybinding* next=nullptr;
     static Keybinding* rebinding_key;
     static Type rebinding_type;
     
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SeriousProton-EE-2024.08.09/src/io/network/tcpSocket.cpp 
new/SeriousProton-EE-2024.12.08/src/io/network/tcpSocket.cpp
--- old/SeriousProton-EE-2024.08.09/src/io/network/tcpSocket.cpp        
2024-08-08 09:44:40.000000000 +0200
+++ new/SeriousProton-EE-2024.12.08/src/io/network/tcpSocket.cpp        
2024-11-06 12:15:14.000000000 +0100
@@ -25,7 +25,11 @@
 #include <arpa/inet.h>
 #include <string.h>
 #include <poll.h>
+#if defined(__APPLE__)
+static constexpr int flags = 0;
+#else
 static constexpr int flags = MSG_NOSIGNAL;
+#endif
 static constexpr intptr_t INVALID_SOCKET = -1;
 #endif
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SeriousProton-EE-2024.08.09/src/io/network/udpSocket.cpp 
new/SeriousProton-EE-2024.12.08/src/io/network/udpSocket.cpp
--- old/SeriousProton-EE-2024.08.09/src/io/network/udpSocket.cpp        
2024-08-08 09:44:40.000000000 +0200
+++ new/SeriousProton-EE-2024.12.08/src/io/network/udpSocket.cpp        
2024-11-06 12:15:14.000000000 +0100
@@ -23,7 +23,11 @@
 #include <arpa/inet.h>
 #include <string.h>
 #include <netdb.h>
+#if defined(__APPLE__)
+static constexpr int flags = 0;
+#else
 static constexpr int flags = MSG_NOSIGNAL;
+#endif
 static constexpr intptr_t INVALID_SOCKET = -1;
 // Define IPV6_ADD_MEMBERSHIP for FreeBSD and Mac OS X
 #ifndef IPV6_ADD_MEMBERSHIP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SeriousProton-EE-2024.08.09/src/multiplayer_client.cpp 
new/SeriousProton-EE-2024.12.08/src/multiplayer_client.cpp
--- old/SeriousProton-EE-2024.08.09/src/multiplayer_client.cpp  2024-08-08 
09:44:40.000000000 +0200
+++ new/SeriousProton-EE-2024.12.08/src/multiplayer_client.cpp  2024-11-06 
12:15:14.000000000 +0100
@@ -65,6 +65,7 @@
         {
         case sp::io::network::StreamSocket::State::Closed:
             status = Disconnected;
+            disconnect_reason = DisconnectReason::FailedToConnect;
             LOG(INFO) << "GameClient: Failed to connect";
             break;
         case sp::io::network::StreamSocket::State::Connecting:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SeriousProton-EE-2024.08.09/src/multiplayer_client.h 
new/SeriousProton-EE-2024.12.08/src/multiplayer_client.h
--- old/SeriousProton-EE-2024.08.09/src/multiplayer_client.h    2024-08-08 
09:44:40.000000000 +0200
+++ new/SeriousProton-EE-2024.12.08/src/multiplayer_client.h    2024-11-06 
12:15:14.000000000 +0100
@@ -32,6 +32,7 @@
     enum class DisconnectReason : uint8_t
     {
         None = 0,
+        FailedToConnect,
         VersionMismatch,
         BadCredentials,
         TimedOut,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SeriousProton-EE-2024.08.09/src/multiplayer_server_scanner.cpp 
new/SeriousProton-EE-2024.12.08/src/multiplayer_server_scanner.cpp
--- old/SeriousProton-EE-2024.08.09/src/multiplayer_server_scanner.cpp  
2024-08-08 09:44:40.000000000 +0200
+++ new/SeriousProton-EE-2024.12.08/src/multiplayer_server_scanner.cpp  
2024-11-06 12:15:14.000000000 +0100
@@ -19,22 +19,7 @@
     abort_wait.notify_all();
     if (master_server_scan_thread.joinable())
         return;
-    LOG(INFO) << "Switching to master server scanning";
-    if (socket)
-    {
-        socket = nullptr;
-    }
-
-    {
-        std::lock_guard<std::mutex> guard(server_list_mutex);
-        for(unsigned int n=0; n<server_list.size(); n++)
-        {
-            if (removedServerCallback)
-                removedServerCallback(server_list[n].address);
-            server_list.erase(server_list.begin() + n);
-            n--;
-        }
-    }
+    LOG(INFO, "Starting master server scanning");
 
     master_server_url = url;
     master_server_scan_thread = 
std::move(std::thread(&ServerScanner::masterServerScanThread, this));
@@ -45,23 +30,7 @@
     if (socket)
         return;
 
-    LOG(INFO) << "Switching to local server scanning";
-    master_server_url = "";
-    abort_wait.notify_all();
-    if (master_server_scan_thread.joinable())
-    {
-        master_server_scan_thread.join();
-    }
-
-    server_list_mutex.lock();
-    for(unsigned int n=0; n<server_list.size(); n++)
-    {
-        if (removedServerCallback)
-            removedServerCallback(server_list[n].address);
-        server_list.erase(server_list.begin() + n);
-        n--;
-    }
-    server_list_mutex.unlock();
+    LOG(INFO, "Starting local server scanning");
 
     socket = std::make_unique<sp::io::network::UdpSocket>();
     int port_nr = server_port + 1;
@@ -76,18 +45,22 @@
 
 void ServerScanner::update(float /*gameDelta*/)
 {
-    server_list_mutex.lock();
+    master_server_list_mutex.lock();
+    for(const auto& info : master_server_update_list) {
+        updateServerEntry(info);
+    }
+    master_server_update_list.clear();
+    master_server_list_mutex.unlock();
     for(unsigned int n=0; n<server_list.size(); n++)
     {
         if (server_list[n].timeout.isExpired())
         {
             if (removedServerCallback)
-                removedServerCallback(server_list[n].address);
+                removedServerCallback(server_list[n]);
             server_list.erase(server_list.begin() + n);
             n--;
         }
     }
-    server_list_mutex.unlock();
 
     if (socket)
     {
@@ -108,40 +81,35 @@
             recv_packet >> verification >> version_nr >> name;
             if (verification == multiplayerVerficationNumber && (version_nr == 
version_number || version_nr == 0 || version_number == 0))
             {
-                updateServerEntry(recv_address, recv_port, name);
+                updateServerEntry({ServerType::LAN, recv_address, 
uint64_t(recv_port), name, {}});
             }
         }
     }
 }
 
-void ServerScanner::updateServerEntry(sp::io::network::Address address, int 
port, string name)
+void ServerScanner::updateServerEntry(const ServerInfo& info)
 {
-    std::lock_guard<std::mutex> guard(server_list_mutex);
-
     for(unsigned int n=0; n<server_list.size(); n++)
     {
-        if (server_list[n].address == address)
+        if (server_list[n].type == info.type && server_list[n].address == 
info.address)
         {
-            server_list[n].port = port;
-            server_list[n].name = name;
+            server_list[n].port = info.port;
+            server_list[n].name = info.name;
             server_list[n].timeout.start(ServerTimeout);
             return;
         }
     }
 
-    LOG(INFO) << "ServerScanner::New server: " << 
address.getHumanReadable()[0] << " " << port << " " << name;
-    ServerInfo si;
-    si.address = address;
-    si.port = port;
-    si.name = name;
+    LOG(INFO) << "ServerScanner::New server: " << 
info.address.getHumanReadable()[0] << " " << info.port << " " << info.name;
+    ServerInfo si = info;
     si.timeout.start(ServerTimeout);
     server_list.push_back(si);
     
     if (newServerCallback)
-        newServerCallback(address, name);
+        newServerCallback(si);
 }
 
-void ServerScanner::addCallbacks(std::function<void(sp::io::network::Address, 
string)> newServerCallbackIn, std::function<void(sp::io::network::Address)> 
removedServerCallbackIn)
+void ServerScanner::addCallbacks(std::function<void(const ServerInfo&)> 
newServerCallbackIn, std::function<void(const ServerInfo&)> 
removedServerCallbackIn)
 {
     this->newServerCallback = newServerCallbackIn;
     this->removedServerCallback = removedServerCallbackIn;
@@ -149,12 +117,7 @@
 
 std::vector<ServerScanner::ServerInfo> ServerScanner::getServerList()
 {   
-    std::vector<ServerScanner::ServerInfo> ret;
-    {
-        std::lock_guard<std::mutex> guard(server_list_mutex);
-        ret = server_list;
-    }
-    return ret;
+    return server_list;
 }
 
 void ServerScanner::masterServerScanThread()
@@ -208,7 +171,9 @@
                 
                 if (version == version_number || version == 0 || 
version_number == 0)
                 {
-                    updateServerEntry(address, part_port, name);
+                    master_server_list_mutex.lock();
+                    
master_server_update_list.push_back({ServerType::MasterServer, address, 
uint64_t(part_port), name, {}});
+                    master_server_list_mutex.unlock();
                 }
             }
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SeriousProton-EE-2024.08.09/src/multiplayer_server_scanner.h 
new/SeriousProton-EE-2024.12.08/src/multiplayer_server_scanner.h
--- old/SeriousProton-EE-2024.08.09/src/multiplayer_server_scanner.h    
2024-08-08 09:44:40.000000000 +0200
+++ new/SeriousProton-EE-2024.12.08/src/multiplayer_server_scanner.h    
2024-11-06 12:15:14.000000000 +0100
@@ -11,33 +11,22 @@
 //Class to find all servers that have the correct version number. Creates a 
big nice list.
 class ServerScanner : public Updatable
 {
-    int server_port;
-    std::unique_ptr<sp::io::network::UdpSocket> socket;
-    sp::SystemTimer broadcast_timer;
-
 public:
+    enum class ServerType {
+        Manual,
+        LAN,
+        MasterServer,
+        SteamFriend,
+    };
     struct ServerInfo
     {
+        ServerType type;
         sp::io::network::Address address;
-        int port;
+        uint64_t port;
         string name;
 
         sp::SystemTimer timeout;
     };
-private:
-    std::vector<struct ServerInfo> server_list;
-    int version_number;
-    constexpr static float BroadcastTimeout = 2.0f;
-    constexpr static float ServerTimeout = 30.0f;
-
-    string master_server_url;
-    std::mutex server_list_mutex;
-    std::thread master_server_scan_thread;
-    std::condition_variable abort_wait;
-
-    std::function<void(sp::io::network::Address, string)> newServerCallback;
-    std::function<void(sp::io::network::Address)> removedServerCallback;
-public:
 
     ServerScanner(int version_number, int server_port = defaultServerPort);
     virtual ~ServerScanner();
@@ -45,7 +34,7 @@
     virtual void destroy() override;
 
     virtual void update(float delta) override;
-    void addCallbacks(std::function<void(sp::io::network::Address, string)> 
newServerCallback, std::function<void(sp::io::network::Address)> 
removedServerCallback);
+    void addCallbacks(std::function<void(const ServerInfo&)> 
newServerCallback, std::function<void(const ServerInfo&)> 
removedServerCallback);
     
     void scanLocalNetwork();
     void scanMasterServer(string url);
@@ -55,7 +44,25 @@
 private:
     void masterServerScanThread();
     
-    void updateServerEntry(sp::io::network::Address address, int port, string 
name);
+    void updateServerEntry(const ServerInfo& info);
+
+    int server_port;
+    std::unique_ptr<sp::io::network::UdpSocket> socket;
+    sp::SystemTimer broadcast_timer;
+
+    std::vector<ServerInfo> server_list;
+    int version_number;
+    constexpr static float BroadcastTimeout = 2.0f;
+    constexpr static float ServerTimeout = 30.0f;
+
+    string master_server_url;
+    std::mutex master_server_list_mutex;
+    std::vector<ServerInfo> master_server_update_list;
+    std::thread master_server_scan_thread;
+    std::condition_variable abort_wait;
+
+    std::function<void(const ServerInfo&)> newServerCallback;
+    std::function<void(const ServerInfo&)> removedServerCallback;
 };
 
 #endif//MULTIPLAYER_SERVER_SCANER_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SeriousProton-EE-2024.08.09/src/scriptInterfaceMagic.h 
new/SeriousProton-EE-2024.12.08/src/scriptInterfaceMagic.h
--- old/SeriousProton-EE-2024.08.09/src/scriptInterfaceMagic.h  2024-08-08 
09:44:40.000000000 +0200
+++ new/SeriousProton-EE-2024.12.08/src/scriptInterfaceMagic.h  2024-11-06 
12:15:14.000000000 +0100
@@ -136,6 +136,11 @@
             luaL_argerror(L, idx-1, msg);
             return;
         }
+        if (*p == NULL)
+        {
+            ptr = NULL;
+            return;
+        }
         ptr = dynamic_cast<T*>(***p);
         //printf("ObjParam: %p\n", ptr);
     }
@@ -165,6 +170,13 @@
             luaL_argerror(L, idx-1, msg);
             return;
         }
+        if (*p == NULL)
+        {
+            ptr = NULL;
+            const char* msg = lua_pushliteral(L, "Object expected, got 
destroyed object");
+            luaL_argerror(L, idx-1, msg);
+            return;
+        }
         ptr = **p;
         //printf("ObjParam: %p\n", ptr);
     }
@@ -529,8 +541,10 @@
         if (lua_isuserdata(L, -1)) //When a subclass is destroyed, it's 
metatable might call the __gc function on it's sub-metatable. So we can get nil 
values here, ignore that.
         {
             PT* p = static_cast< PT* >(lua_touserdata(L, -1));
-            if (*p)
+            if (*p) {
                 delete *p;
+                *p = nullptr;
+            }
         }
         lua_pop(L, 1);
         return 0;

Reply via email to