Skip to content

Instantly share code, notes, and snippets.

ericallam /
Created Sep 2, 2020
TextureFromFile leak post-mortem

TextureFromFile leak post-mortem

Usages of TextureFromFile in the game to load an image from StreamingAssets could lead to a memory leak of the loaded texture in the case of the TextureFromFile instance being cancelled before it finished.

This would happen in the case of the saga map collection view object reuse (e.g. SagaMapPlayStoryPolaroid) where a view object would be loaded and an initial TextureFromFile instance would get created, and then in the same frame that view object would be recycled and reused for a different section of the map, causing that original TextureFromFile instance to be cancelled.

The TextureFromFile.Cancel method looked like this:

public void Cancel()
ericallam / leak1.cs
Created Sep 2, 2020
UnityWebRequest DownloadTexture leak
View leak1.cs
using System;
using System.Collections.Generic;
using MEC;
using RSG;
using UnityEngine;
using UnityEngine.Networking;
// This is the original implementation
namespace DefaultNamespace

Keybase proof

I hereby claim:

  • I am ericallam on github.
  • I am eallam ( on keybase.
  • I have a public key ASBmNg1iFy8fqoyVlxPpWUjlx_FQi7wvtp0phG5or9ijhAo

To claim this, I am signing this object:

View gist:fc719b79e8d300a790c3dd74e97c854d
2019-03-19 11:45:41 Using SAM Template at /Users/eric/code/Solve/opensource/ship-logs-to-honeycomb/template.yml
2019-03-19 11:45:41 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-03-19 11:45:41 Changing event name from before-call.apigateway to before-call.api-gateway
2019-03-19 11:45:41 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-03-19 11:45:41 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to
2019-03-19 11:45:41 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-03-19 11:45:41 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-03-19 11:45:41 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*
ericallam / AssemblyCompilationReporter.cs
Created Apr 10, 2018
Unity - Log Assembly Compilation times
View AssemblyCompilationReporter.cs
namespace Editor {
public class AssemblyCompilationReporter {
private static void Init() {
CompilationPipeline.assemblyCompilationStarted += CompilationPipelineOnAssemblyCompilationStarted;
CompilationPipeline.assemblyCompilationFinished += CompilationPipelineOnAssemblyCompilationFinished;
private static void CompilationPipelineOnAssemblyCompilationFinished(string s, CompilerMessage[] compilerMessages) {
View getblockchaininfo.json
"chain": "main",
"blocks": 0,
"headers": 16000,
"bestblockhash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
"difficulty": 1,
"mediantime": 1231006505,
"verificationprogress": 3.715029412543562e-09,
"chainwork": "0000000000000000000000000000000000000000000000000000000100010001",
"pruned": false,
View Terminal
# Generated by
# This config should be placed in following path:
# ~/.bitcoin/bitcoin.conf
# [core]
# Specify a non-default location to store blockchain and other data.
# Set database cache size in megabytes; machines sync faster with a larger cache. Recommend setting as high as possible based upon machine's available RAM.
View bitcoin.service
Description=Bitcoin's distributed currency daemon
View gist:44d13748dae5bd5198431c9918d1f952
bitcoin@bitcoin-full-node-1:~# bitcoind --version
Bitcoin Core Daemon version v0.15.0.0-g3751912e8e
Copyright (C) 2009-2017 The Bitcoin Core developers
Please contribute if you find Bitcoin Core useful. Visit
<> for further information about the software.
The source code is available from <>.
This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING