summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp13
-rw-r--r--modules/gdnative/videodecoder/register_types.cpp10
2 files changed, 13 insertions, 10 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index ea6c83f49c..b0e812a130 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -2033,16 +2033,19 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
// Find the item to select
CanvasItem *canvas_item = NULL;
- Vector<_SelectResult> selection;
-
- // Retrieve the items
- _get_canvas_items_at_pos(click, selection);
// Retrieve the bones
+ Vector<_SelectResult> selection = Vector<_SelectResult>();
_get_bones_at_pos(click, selection);
-
if (!selection.empty()) {
canvas_item = selection[0].item;
+ } else {
+ // Retrieve the canvas items
+ selection = Vector<_SelectResult>();
+ _get_canvas_items_at_pos(click, selection);
+ if (!selection.empty()) {
+ canvas_item = selection[0].item;
+ }
}
if (!canvas_item) {
diff --git a/modules/gdnative/videodecoder/register_types.cpp b/modules/gdnative/videodecoder/register_types.cpp
index f2c4ab6d3b..ea78cb1970 100644
--- a/modules/gdnative/videodecoder/register_types.cpp
+++ b/modules/gdnative/videodecoder/register_types.cpp
@@ -33,18 +33,18 @@
#include "core/class_db.h"
#include "video_stream_gdnative.h"
-static ResourceFormatLoaderVideoStreamGDNative *resource_loader_vsgdnative = NULL;
+static Ref<ResourceFormatLoaderVideoStreamGDNative> resource_loader_vsgdnative;
void register_videodecoder_types() {
- resource_loader_vsgdnative = memnew(ResourceFormatLoaderVideoStreamGDNative);
+ resource_loader_vsgdnative.instance();
ResourceLoader::add_resource_format_loader(resource_loader_vsgdnative, true);
+
ClassDB::register_class<VideoStreamGDNative>();
}
void unregister_videodecoder_types() {
- if (resource_loader_vsgdnative) {
- memdelete(resource_loader_vsgdnative);
- }
+ ResourceLoader::remove_resource_format_loader(resource_loader_vsgdnative);
+ resource_loader_vsgdnative.unref();
}