Skip to content

Bug. Error registering an item in a previously uploaded category. #132

@IL0co

Description

@IL0co

Describe the bug
Due to the fact that the category is badly unloaded, it deletes all handles behind itself. And if you register an item in this category again, then an error will be thrown due to invalid handles.

Module for testing.
shop_test.txt

To Reproduce
Steps to reproduce the behavior:

  1. Reload the shop. (not necessary)
  2. Load my module for testing (sm plugin load).
  3. Reload the module for testing (sm plugins reload).
  4. Get an error.

Server (please complete the following information):

  • OS: Windows (local test server)
  • Sourcemod version: 1.10.0.6528
  • Shop Version: 3.0E4

Console Log

	# I reload the shop to clear it.
] sm plugins reload shop
[Shop] Trying to connect!
[SM] Plugin [Shop] Core reloaded successfully.
 [Shop] Ваши данные магазина были загружены! Введите в чате !shop для доступа к магазину!

	# Loading my module.
] sm plugins load shop_test
Created new category
[SM] Loaded plugin shop_test.smx successfully.
 [Shop] Ваши данные магазина были загружены! Введите в чате !shop для доступа к магазину!
	# Shop loaded normally.

	# I reload my module, the module found an already created category and tries to register an item in it and an error pops up.
] sm plugins reload shop_test
Category founded
L 04/25/2022 - 22:34:49: [SM] Exception reported: Invalid Handle 0 (error 4)
L 04/25/2022 - 22:34:49: [SM] Blaming: shop.smx
L 04/25/2022 - 22:34:49: [SM] Call stack trace:
L 04/25/2022 - 22:34:49: [SM]   [0] StringMap.GetValue
L 04/25/2022 - 22:34:49: [SM]   [1] Line 364, c:\mygithub\Shop-Core\addons\sourcemod\scripting\shop/item_manager.sp::ItemManager_StartItem
L 04/25/2022 - 22:34:49: [SM]   [3] Shop_StartItem
L 04/25/2022 - 22:34:49: [SM]   [4] Line 29, d:\scripting\shop_test.sp::Shop_Started
L 04/25/2022 - 22:34:49: [SM]   [5] Line 14, d:\scripting\shop_test.sp::OnPluginStart
[SM] Plugin shop_test.smx failed to reload: Error detected in plugin startup (see error logs).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions