summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/variant/variant.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp6
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h1
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp7
-rw-r--r--editor/plugins/node_3d_editor_plugin.h1
-rw-r--r--editor/plugins/tiles/tile_data_editors.cpp2
-rw-r--r--modules/mono/editor/bindings_generator.cpp2
-rw-r--r--scene/gui/popup_menu.cpp6
-rw-r--r--tests/core/variant/test_variant.h8
9 files changed, 25 insertions, 10 deletions
diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp
index 04e1561a0c..2da9559873 100644
--- a/core/variant/variant.cpp
+++ b/core/variant/variant.cpp
@@ -3499,7 +3499,7 @@ bool Variant::identity_compare(const Variant &p_variant) const {
switch (type) {
case OBJECT: {
- return _get_obj().obj == p_variant._get_obj().obj;
+ return _get_obj().id == p_variant._get_obj().id;
} break;
case DICTIONARY: {
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 0f9ce89f02..75a444c877 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -896,15 +896,16 @@ void CanvasItemEditor::_snap_changed() {
}
void CanvasItemEditor::_selection_result_pressed(int p_result) {
- if (selection_results.size() <= p_result) {
+ if (selection_results_menu.size() <= p_result) {
return;
}
- CanvasItem *item = selection_results[p_result].item;
+ CanvasItem *item = selection_results_menu[p_result].item;
if (item) {
_select_click_on_item(item, Point2(), selection_menu_additive_selection);
}
+ selection_results_menu.clear();
}
void CanvasItemEditor::_selection_menu_hide() {
@@ -2247,6 +2248,7 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
selection_menu->set_item_tooltip(i, String(item->get_name()) + "\nType: " + item->get_class() + "\nPath: " + node_path);
}
+ selection_results_menu = selection_results;
selection_menu_additive_selection = b->is_shift_pressed();
selection_menu->set_position(viewport->get_screen_transform().xform(b->get_position()));
selection_menu->reset_size();
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index ebe87a56f7..c5b9bf9e0b 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -256,6 +256,7 @@ private:
}
};
Vector<_SelectResult> selection_results;
+ Vector<_SelectResult> selection_results_menu;
struct _HoverResult {
Point2 position;
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 96f5aeedf0..6580340af4 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -1543,6 +1543,7 @@ void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
selection_menu->set_item_tooltip(i, String(spat->get_name()) + "\nType: " + spat->get_class() + "\nPath: " + node_path);
}
+ selection_results_menu = selection_results;
selection_menu->set_position(get_screen_position() + b->get_position());
selection_menu->reset_size();
selection_menu->popup();
@@ -3609,15 +3610,17 @@ void Node3DEditorViewport::_toggle_cinema_preview(bool p_activate) {
}
void Node3DEditorViewport::_selection_result_pressed(int p_result) {
- if (selection_results.size() <= p_result) {
+ if (selection_results_menu.size() <= p_result) {
return;
}
- clicked = selection_results[p_result].item->get_instance_id();
+ clicked = selection_results_menu[p_result].item->get_instance_id();
if (clicked.is_valid()) {
_select_clicked(spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
}
+
+ selection_results_menu.clear();
}
void Node3DEditorViewport::_selection_menu_hide() {
diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h
index a1fd9757d0..e5267e5fad 100644
--- a/editor/plugins/node_3d_editor_plugin.h
+++ b/editor/plugins/node_3d_editor_plugin.h
@@ -290,6 +290,7 @@ private:
ObjectID clicked;
ObjectID material_target;
Vector<_RayResult> selection_results;
+ Vector<_RayResult> selection_results_menu;
bool clicked_wants_append = false;
bool selection_in_progress = false;
diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp
index 3dd0c84ee7..73d2da63b7 100644
--- a/editor/plugins/tiles/tile_data_editors.cpp
+++ b/editor/plugins/tiles/tile_data_editors.cpp
@@ -784,7 +784,7 @@ void GenericTilePolygonEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("remove_polygon", "index"), &GenericTilePolygonEditor::remove_polygon);
ClassDB::bind_method(D_METHOD("clear_polygons"), &GenericTilePolygonEditor::clear_polygons);
ClassDB::bind_method(D_METHOD("set_polygon", "index", "polygon"), &GenericTilePolygonEditor::set_polygon);
- ClassDB::bind_method(D_METHOD("get_polygon", "index"), &GenericTilePolygonEditor::set_polygon);
+ ClassDB::bind_method(D_METHOD("get_polygon", "index"), &GenericTilePolygonEditor::get_polygon);
ADD_SIGNAL(MethodInfo("polygons_changed"));
}
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp
index ad6306bb41..cbe5266f7e 100644
--- a/modules/mono/editor/bindings_generator.cpp
+++ b/modules/mono/editor/bindings_generator.cpp
@@ -2831,7 +2831,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
TypeInterface itype = TypeInterface::create_object_type(type_cname, pascal_to_pascal_case(type_cname), api_type);
itype.base_name = ClassDB::get_parent_class(type_cname);
- itype.is_singleton = Engine::get_singleton()->has_singleton(itype.proxy_name);
+ itype.is_singleton = Engine::get_singleton()->has_singleton(type_cname);
itype.is_instantiable = class_info->creation_func && !itype.is_singleton;
itype.is_ref_counted = ClassDB::is_parent_class(type_cname, name_cache.type_RefCounted);
itype.memory_own = itype.is_ref_counted;
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index cf73729c0a..1a6adca121 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -1715,12 +1715,12 @@ void PopupMenu::activate_item(int p_item) {
need_hide = false;
}
- emit_signal(SNAME("id_pressed"), id);
- emit_signal(SNAME("index_pressed"), p_item);
-
if (need_hide) {
hide();
}
+
+ emit_signal(SNAME("id_pressed"), id);
+ emit_signal(SNAME("index_pressed"), p_item);
}
void PopupMenu::remove_item(int p_idx) {
diff --git a/tests/core/variant/test_variant.h b/tests/core/variant/test_variant.h
index dfbaa36af8..024fcf53c4 100644
--- a/tests/core/variant/test_variant.h
+++ b/tests/core/variant/test_variant.h
@@ -1056,6 +1056,14 @@ TEST_CASE("[Variant] Identity comparison") {
Variant obj_null_two_var = Variant((Object *)nullptr);
CHECK(obj_null_one_var.identity_compare(obj_null_one_var));
CHECK(obj_null_one_var.identity_compare(obj_null_two_var));
+
+ Object *freed_one = new Object();
+ Variant freed_one_var = freed_one;
+ delete freed_one;
+ Object *freed_two = new Object();
+ Variant freed_two_var = freed_two;
+ delete freed_two;
+ CHECK_FALSE(freed_one_var.identity_compare(freed_two_var));
}
TEST_CASE("[Variant] Nested array comparison") {